On 4/25/08, Aaron Spike <aaron@ekips.org> wrote:
Hystrix wrote:
> I'm trying to write a script that takes a color palette and reorders its
> colors in some predefined way. To do this I'd like to have the colors
> arranged acording to the luminance value and then
> to the hue value but the colors in the palette file are in RGB so first I need to calculate the HLS values.
> That's why I'd like to see the code Inkscape uses to change from the RGB to HLS.


When we were generating palettes we used python and the colorsys module:

http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/share/palettes/PaletteGen.py?view=markup


Aaron Spike

Thanks Aaron, that's even better than what I was asking for.
I should have looked for something like that in Python docs.


--
Hystrix