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!
====HSI to RGB==== Given an HSI color with hue {{math|''H'' β [0Β°, 360Β°)}}, saturation {{math|''S''<sub>''I''</sub> β [0, 1]}}, and intensity {{math|''I'' β [0, 1]}}, we can use the same strategy, in a slightly different order: : <math>H^\prime = \frac{H}{60^\circ}</math> : <math>Z = 1 - |H^\prime \;\bmod 2 - 1|</math> : <math>C = \frac{3 \cdot I \cdot S_I}{1 + Z}</math> : <math>X = C \cdot Z</math> Where <math>C</math> is the chroma. Then we can, again, find a point {{math|(''R''<sub>1</sub>, ''G''<sub>1</sub>, ''B''<sub>1</sub>)}} along the bottom three faces of the RGB cube, with the same hue and chroma as our color (using the intermediate value ''X'' for the second largest component of this color): : <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. Finally, we can find ''R'', ''G'', and ''B'' by adding the same amount to each component, to match lightness: : <math>m = I \cdot (1 - S_I)</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)