RSS/Atom feed Twitter
Site is read-only, email is disabled

Hue-Saturation dialog

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

Hue-Saturation dialog Martin Weber 24 Sep 14:11
Martin Weber
2002-09-24 14:11:17 UTC (over 21 years ago)

Hue-Saturation dialog

The file app/huesaturation.c contains a conceptual bug. Have a look at the function hue_saturation:
if (r < 43)
hue = 0;
else if (r < 85)
hue = 1;
else if (r < 128)
hue = 2;
else if (r < 171)
hue = 3;
else if (r < 213)
hue = 4;
else
hue = 5;
hue = 0 stands for red but in reality it is red ... [yellow] hue = 1 stands for red but in reality it is yellow ... [green] hue = 2 stands for red but in reality it is green ... [cyan] hue = 3 stands for red but in reality it is cyan ... [blue] hue = 4 stands for red but in reality it is blue ... [magenta] hue = 5 stands for red but in reality it is magenta ... [red] So in the dialog red stands for a red color that can also be nearly pure yellow, but a color that looks nearly red with a small percentage of magenta you will not find as red but as magenta only. This behaviour confuses the user. Red should be a red with a certain percentage of yellow as well as a red with a certain percentage of magenta. So here is the corrected code: if (r < 21)
hue = 0;
else if (r < 64)
hue = 1;
else if (r < 106)
hue = 2;
else if (r < 149)
hue = 3;
else if (r < 191)
hue = 4;
else if (r < 234)
hue = 5;
else
hue = 0;