Star Hype News.

Premium celebrity moments with standout appeal.

general

HSL to RGB conversion

By Sophia Bowman
$\begingroup$

I have some problems understanding the formulas for conversion from HSL to RGB color model.

enter image description here

enter image description here

enter image description here

enter image description here

Let's take for example H = 60 degrees, S = 0.7. L = 0.5.

And we start with C, which is 1 - | 1 - 1 | x 0.7 = 0.7 (if x means to multiply them, does it mean to multiply?)

Then H' is 1.

And now how to find X?
X is C( 1 - 1 ) isn't it? But what means C( of something) :S

Then we find m = 0.5 - 0.35 = 0.15.

Can someone continue my example and tell if the steps so far are correct and especially how to find X. Thank you very much in advance! :)

$\endgroup$ 2

1 Answer

$\begingroup$

Your steps so far are correct, and the $\times$ means multiplication.

By $X = C(1-|H'\text{ mod }2 - 1|)$, they mean $X = C\times(1-|H'\text{ mod }2 - 1|)$. A common convention in mathematics is to leave out multiplication signs when no confusion can arise (and apparently, also when it can).

This leads to $$ X = 0.7\times(1-|1-1|) = 0.7 $$ and thus to $(R_1,G_1,B_1) = (0.7,0.7,0)$. Then $(R,G,B) = (0.85,0.85,0.15)$.

$\endgroup$ 3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy