Fixed issue where red/orange/yellow names are improperly colored.
This commit is contained in:
parent
97ccf969c0
commit
0fb8977c94
@ -70,7 +70,7 @@ void rgb2hsl(struct Hls *dest, const struct Rgb const *src) {
|
|||||||
//piecewise function..
|
//piecewise function..
|
||||||
float hue;
|
float hue;
|
||||||
if (max == r) {
|
if (max == r) {
|
||||||
hue = (int)((g - b)/chroma) + (g < b ? 6 : 0); // % 6 will break magenta (255, 0, 255)
|
hue = ((g - b)/chroma) + (g < b ? 6 : 0); // % 6 will break magenta (255, 0, 255)
|
||||||
} else if (max == g) {
|
} else if (max == g) {
|
||||||
hue = ((b - r)/chroma) + 2.0f;
|
hue = ((b - r)/chroma) + 2.0f;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user