Let's say that I have a Color
. I extract the rgb
values.
Hypothetically
- r = 90
- g = 240
- b = 8
I also have the L value
from HSL
. Nothing else from HSL.
Explanation of Lightness (L):
L var can take value from 0 to 1.
- If it's
>0.5
then it's brighter. //1 is white - If it's
<0.5
then it's darker. //0 is black - If it's
=0.5
then it's neutral.
So my question is:
How can i change the rgb values using the L value?
For example if L = 0.45 then the rgb values decrease a little. Else if L = 0.8 the rgb values add alot. Also i am coding in Java if it helps with the answear.