Color wheel: Difference between revisions

Content deleted Content added
→‎{{header|Processing_Python}}: comment about unusual Processing set()
Added Processing task
Line 401:
 
main()</lang>
 
=={{header|Processing}}==
<lang java>size(300, 300);
background(0);
float radius = min(width, height) / 2.0;
float cx = width / 2;
float cy = width / 2;
for (int x = 0; x < width; x++) {
for (int y = 0; y < width; y++) {
float rx = x - cx;
float ry = y - cy;
float s = sqrt(sq(rx) + sq(ry)) / radius;
if (s <= 1.0) {
float h = ((atan2(ry, rx) / PI) + 1.0) / 2.0;
colorMode(HSB);
color c = color(int(h * 255), int(s * 255), 255);
set(x, y, c);
}
}
}</lang>
 
=={{header|Processing_Python}}==