Hacker News new | ask | show | jobs
by thangalin 3385 days ago
Here's XSLT code that transforms RGB colour space into LCH (and vice versa), which is then used to colourise an arbitrary number of visually distinct and harmonious pie chart wedges:

http://stackoverflow.com/a/25481023/59087

The algorithm is straightforward, albeit verbose.

1 comments

I'll add my shot at converting RGB to CIE (XY + brightness) I wrote for my command line controller for Hue lights:

https://github.com/TeMPOraL/hju/blob/39b0c2c27f5f076a93b360d...

(code in Common Lisp)

Hue documentation (available after registering with them) also has example algorithm in (AFAIR) Objective-C.

EDIT: replaced Github link with commit permalink, in case I change the file in the future.