Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
HSL and HSV
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Luma, chroma and hue to RGB==== Given a color with hue {{math|''H'' β [0Β°, 360Β°)}}, chroma {{math|''C'' β [0, 1]}}, and luma {{math|''{{prime|Y}}''<sub>601</sub> β [0, 1]}},{{refn|group=upper-alpha |Some points in this cylinder fall out of [[gamut]].}} we can again use the same strategy. Since we already have ''H'' and ''C'', we can straightaway find our point {{math|(''R''<sub>1</sub>, ''G''<sub>1</sub>, ''B''<sub>1</sub>)}} along the bottom three faces of the RGB cube: : <math>\begin{align} H^\prime &= \frac{H}{60^\circ} \\ X &= C \times (1 - |H^\prime \bmod 2 - 1|) \end{align}</math> : <math>(R_1, G_1, B_1) = \begin{cases} (0, 0, 0) &\text{if } H \text{ is undefined} \\ (C, X, 0) &\text{if } 0 \leq H^\prime \leq 1 \\ (X, C, 0) &\text{if } 1 \leq H^\prime \leq 2 \\ (0, C, X) &\text{if } 2 \leq H^\prime \leq 3 \\ (0, X, C) &\text{if } 3 \leq H^\prime \leq 4 \\ (X, 0, C) &\text{if } 4 \leq H^\prime \leq 5 \\ (C, 0, X) &\text{if } 5 \leq H^\prime < 6 \end{cases}</math> Overlap (when <math>H^\prime</math> is an integer) occurs because two ways to calculate the value are equivalent: <math>X = 0</math> or <math>X = C</math>, as appropriate. Then we can find ''R'', ''G'', and ''B'' by adding the same amount to each component, to match luma: : <math>m = Y^\prime_{601} - (0.30R_1 + 0.59G_1 + 0.11B_1)</math> : <math>(R, G, B) = (R_1 + m, G_1 + m, B_1 + m)</math>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)