Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- size(512, 512);
- background(0xffffffff);
- noStroke();
- colorMode(HSB, 359, 99, 99);
- ellipseMode(RADIUS);
- textAlign(CENTER, CENTER);
- int count = 16;
- float centerX = width * 0.5;
- float centerY = height * 0.5;
- float radius = 42;
- float dist = min(height, width) * 0.5 - radius;
- float angle;
- float hue;
- float x;
- float y;
- float radToDeg = 360 / TWO_PI;
- float countToRad = TWO_PI / float(count);
- String label = "";
- for (int i = 0; i < count; ++i) {
- angle = i * countToRad;
- hue = angle * radToDeg;
- x = centerX + cos(angle) * dist;
- y = centerY + sin(angle) * dist;
- label = ceil(hue) + "\u00b0";
- fill(color(hue, 99, 99));
- ellipse(x, y, radius, radius);
- fill(0xff000000);
- text(label, x, y);
- fill(0xffffffff);
- text(label, x + 1, y - 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement