Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/Color-wheel/Processing/color-wheel.processing
Normal file
18
Task/Color-wheel/Processing/color-wheel.processing
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue