Lines Matching refs:HLSMAX
149 const int HLSMAX = 100; in hue_to_rgb() local
152 hue += HLSMAX; in hue_to_rgb()
155 if (hue > HLSMAX) { in hue_to_rgb()
156 hue -= HLSMAX; in hue_to_rgb()
159 if (hue < (HLSMAX / 6)) { in hue_to_rgb()
160 return (n1 + (((n2 - n1) * hue + (HLSMAX / 12)) / (HLSMAX / 6))); in hue_to_rgb()
162 if (hue < (HLSMAX / 2)) { in hue_to_rgb()
165 if (hue < ((HLSMAX * 2) / 3)) { in hue_to_rgb()
166 return (n1 + (((n2 - n1) * (((HLSMAX * 2) / 3) - hue) + (HLSMAX / 12))/(HLSMAX / 6))); in hue_to_rgb()
176 const int HLSMAX = 100; in hls_to_rgb() local
179 R = G = B = (lum * RGBMAX) / HLSMAX; in hls_to_rgb()
181 if (lum <= (HLSMAX / 2)) { in hls_to_rgb()
182 Magic2 = (lum * (HLSMAX + sat) + (HLSMAX / 2)) / HLSMAX; in hls_to_rgb()
184 Magic2 = lum + sat - ((lum * sat) + (HLSMAX / 2)) / HLSMAX; in hls_to_rgb()
188 R = (hue_to_rgb(Magic1, Magic2, hue + (HLSMAX / 3)) * RGBMAX + (HLSMAX / 2)) / HLSMAX; in hls_to_rgb()
189 G = (hue_to_rgb(Magic1, Magic2, hue) * RGBMAX + (HLSMAX / 2)) / HLSMAX; in hls_to_rgb()
190 B = (hue_to_rgb(Magic1, Magic2, hue - (HLSMAX / 3)) * RGBMAX + (HLSMAX/2)) / HLSMAX; in hls_to_rgb()