Color wheel: Difference between revisions
Content deleted Content added
→{{header|Perl 6}}: added zkl |
→{{header|zkl}}: added info |
||
Line 76: | Line 76: | ||
A color square - I just fill a square with the color wheel, it could be clipped to a circle if needed. |
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). |
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); |
<lang zkl>var w=300,h=300,out=PPM(w,h); |
||
colorWheel(out); |
colorWheel(out); |