Lines Matching refs:hue
147 static int hue_to_rgb(int n1, int n2, int hue) in hue_to_rgb() argument
151 if (hue < 0) { in hue_to_rgb()
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()
171 static int hls_to_rgb(int hue, int lum, int sat) in hls_to_rgb() argument
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()