Gimp-Forum.net
Math and Code behind Hue-Saturation Tool - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Math and Code behind Hue-Saturation Tool (/Thread-Math-and-Code-behind-Hue-Saturation-Tool)



Math and Code behind Hue-Saturation Tool - heavy_duty - 05-01-2019

Hello, I have been using GIMP for a long time. However, I am unable to understand the logic behind one operation. If I were to do Color Enhancement (Hue-Saturation), and I select a Primary color (say Red), I see that only certain colors are enhanced. What is the logic behind this? I am aware of the following:
a.) RGB -> HSL
b.) HSL -> RGB
c.) Saturation Factor if enhancement in saturation (say 40%)
d.) But..what is primary color?

The math behind this would be really helpful. If someone can shed some thoughts on this it would be helpful.