I'm struggling with something that perhaps one of you legitimate developers can shed some light on--color conversion. Through the colorpicker field type, Indigo provides hooks into the Mac color picker and the result is a hex string representation of the color (like 'FF 00 00'). The Inovelli dimmer I just bought (and likely many, many other devices) store the color value as a hue (0-255, with 255 apparently reserved for white). But because the hue value can be 0-360, valid entries must be scaled: hue/360 * 255. I can't even figure out whether the hue value is an HSV or HSB (or if there is a difference). I want to convert using Python and my research leads me to believe that in order to make the conversion, I have to go hex --> rgb --> hue, but all my attempts have so far been fails. colorsys() seemingly gets me part of the way there, but I'm still coming up short. I did come across some discussions of converting to opencv (whatever that is) but most of that was in C+ or Java.
I can work around this by just using a textfield limited to values from 0-255, but what I'd like is to be able to select a color in the Mac color picker, calculate the nearest hue value, and blow that up to the device for setting parms.