circle
Draw a circle
circle(
x,
y,
radius,
[stroke=#000000],
[fill=#FFFFFF],
[weight=1.00]
)
Draw a circle
Syntaxe
circle(x=10, y=10, radius=5, stroke="#000000", fill="#FFA000", weight=4)
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
x | yes | - | x-coordinate of the center | |
y | yes | - | y-coordinate of the center | |
radius | yes | - | Radius of the circle | |
stroke | - | #000000 | Stroke color | |
fill | - | #FFFFFF | Fill color | |
weight | - | 1.00 | Stroke weight (thickness) |
Full example
var palette = palette_blend("#F2BC00", "#C03228", 10);
var cycle = 5;
canvas(800, 800, "#020410", center=true);
var padding = 20;
var x = 0;
var y = 0;
var radius = height()/2 - padding;
stroke("transparent");
var col = 0;
var totalRings = length(palette) * cycle;
for (var j = 0; j < totalRings; j++) {
var currentRadius = radius - j * (radius / totalRings);
fill(palette[j % length(palette)]);
circle(x, y, currentRadius);
}
save(whoami(png=true));
