Template talk:HSLtoRGB.R
The discussion pages for the implementation and documentation pages of
are all redirected to this common talk page.
- Example of color palette generation
This palette generates a spiral palette, whose hue turns nearly 3 times around the color circle, saturation grows from 66.7% to 100%, and lightness grows from 40% to 79%; in that palette, all colors have distinct hue, saturation and lightness values, and at least two distinct values of red, green or blue components.
H | S | L | R | G | B |
---|---|---|---|---|---|
36.7*0 | 2/3+1/90*0 | 0.4+0.013*0 | 170 | 34 | 34 |
36.7*1 | 2/3+1/90*1 | 0.4+0.013*1 | 177 | 121 | 34 |
36.7*2 | 2/3+1/90*2 | 0.4+0.013*2 | 150 | 183 | 34 |
36.7*3 | 2/3+1/90*3 | 0.4+0.013*3 | 59 | 190 | 34 |
36.7*4 | 2/3+1/90*4 | 0.4+0.013*4 | 33 | 197 | 107 |
36.7*5 | 2/3+1/90*5 | 0.4+0.013*5 | 33 | 194 | 204 |
36.7*6 | 2/3+1/90*6 | 0.4+0.013*6 | 33 | 91 | 211 |
36.7*7 | 2/3+1/90*7 | 0.4+0.013*7 | 85 | 32 | 218 |
36.7*8 | 2/3+1/90*8 | 0.4+0.013*8 | 204 | 33 | 224 |
36.7*9 | 2/3+1/90*9 | 0.4+0.013*9 | 226 | 37 | 131 |
36.7*10 | 2/3+1/90*10 | 0.4+0.013*10 | 228 | 64 | 42 |
36.7*11 | 2/3+1/90*11 | 0.4+0.013*11 | 230 | 180 | 47 |
36.7*12 | 2/3+1/90*12 | 0.4+0.013*12 | 171 | 232 | 51 |
36.7*13 | 2/3+1/90*13 | 0.4+0.013*13 | 65 | 234 | 56 |
36.7*14 | 2/3+1/90*14 | 0.4+0.013*14 | 61 | 236 | 160 |
36.7*15 | 2/3+1/90*15 | 0.4+0.013*15 | 66 | 208 | 238 |
36.7*16 | 2/3+1/90*16 | 0.4+0.013*16 | 71 | 107 | 239 |
36.7*17 | 2/3+1/90*17 | 0.4+0.013*17 | 142 | 76 | 241 |
36.7*18 | 2/3+1/90*18 | 0.4+0.013*18 | 243 | 81 | 241 |
36.7*19 | 2/3+1/90*19 | 0.4+0.013*19 | 244 | 86 | 146 |
36.7*20 | 2/3+1/90*20 | 0.4+0.013*20 | 245 | 127 | 91 |
36.7*21 | 2/3+1/90*21 | 0.4+0.013*21 | 247 | 223 | 97 |
36.7*22 | 2/3+1/90*22 | 0.4+0.013*22 | 181 | 248 | 102 |
36.7*23 | 2/3+1/90*23 | 0.4+0.013*23 | 107 | 249 | 117 |
36.7*24 | 2/3+1/90*24 | 0.4+0.013*24 | 113 | 250 | 206 |
36.7*25 | 2/3+1/90*25 | 0.4+0.013*25 | 119 | 212 | 251 |
36.7*26 | 2/3+1/90*26 | 0.4+0.013*26 | 124 | 137 | 252 |
36.7*27 | 2/3+1/90*27 | 0.4+0.013*27 | 193 | 130 | 253 |
36.7*28 | 2/3+1/90*28 | 0.4+0.013*28 | 254 | 136 | 239 |
36.7*29 | 2/3+1/90*29 | 0.4+0.013*29 | 254 | 142 | 171 |
36.7*30 | 2/3+1/90*30 | 0.4+0.013*30 | 255 | 185 | 148 |
Mistakes
editHi
I've spend plenty of time with searching for the mistakes in this post, so be warned: the brackets around (H mod 360) are not correct / sometimes missing. I can just post parts of my working csharp code here: G = lum - (1 - (hue % 360) / 30.0) * sat * (1 - lum); G = (1 - (1 - (hue % 360) / 30) * sat) * lum; AvMrk (talk) 20:56, 29 July 2010 (UTC)