From: Tom B. <tom...@gm...> - 2014-01-25 16:07:32
|
I've been looking at the color tests (in src/libbu/tests) which don't fare well. In my limited research I see that going between an RGB and other systems don't round-trip very well, especially when we start with an integer RGB representation. I have fiddled with several things to try to help the situation: + an int/float RGB conversion function that uses a forced precision and sprintf for string comparisons (max of three decimal places helps a LOT) + an rgb float <=> hsv function instead of the rgb integer <=> hsv version + modified the rgb <=> hsv based on other algorithms and actual results compared to a table of color values I found here: http://en.wikipedia.org/wiki/HSL_and_HSV It seems to me we need to decide on precisely what we want for standard color handling and then make the functions round trip if we need to do that. Comments welcome. Best regards, -Tom |