Color wheel: Difference between revisions

(→‎{{header|zkl}}: added info)
Line 76:
A color square - I just fill a square with the color wheel, it could be clipped to a circle if needed.
Each point in the square is converted to polar coordinates, the angle is hue and the radius is saturation (which is scaled by the distance from the pole).
 
Uses the PPM class from http://rosettacode.org/wiki/Bitmap/Bresenham%27s_line_algorithm#zkl
<lang zkl>var w=300,h=300,out=PPM(w,h);
colorWheel(out);
Anonymous user