Color managment
-
Hi, I'm creating a button, that has specified BG color. Color of it's text is calculated using simple algorithm from this BG color. For this purpose, I use HSL color scheme. algorithm of text color calculation is very simple : Hue - same as background Saturation - 0 Luminance - if background luminance exceeds 0.5f , set 0F, else 1f otherwords - use white color if the bacground color is kind of dark, otherwise use black color. And now my problem : lets say we have a color like : Hue = whatever Saturation = 1f Luminance = .5f (that should be clearest mixture for any hue) the problem is that some color values are very bright in this configuration and some are very dark: pure blue (0.66 hue) - too dark cyan (0.5f hue) - too bright so sometimes the difference(for human eye) between specified background color and calculated text color is almost none (even when luminance difference is at least .5f) can you help me out with any better way to calculate text color (I would like to keep it in gray scale) thanx :) I hope you'll understand my English :)))
-
Hi, I'm creating a button, that has specified BG color. Color of it's text is calculated using simple algorithm from this BG color. For this purpose, I use HSL color scheme. algorithm of text color calculation is very simple : Hue - same as background Saturation - 0 Luminance - if background luminance exceeds 0.5f , set 0F, else 1f otherwords - use white color if the bacground color is kind of dark, otherwise use black color. And now my problem : lets say we have a color like : Hue = whatever Saturation = 1f Luminance = .5f (that should be clearest mixture for any hue) the problem is that some color values are very bright in this configuration and some are very dark: pure blue (0.66 hue) - too dark cyan (0.5f hue) - too bright so sometimes the difference(for human eye) between specified background color and calculated text color is almost none (even when luminance difference is at least .5f) can you help me out with any better way to calculate text color (I would like to keep it in gray scale) thanx :) I hope you'll understand my English :)))