circle
circle(x, y, radius, [stroke], [fill], [weight])
Draw a circle
Syntaxe
circle(x=10, y=10, radius=5, stroke="#000000", fill="#FFA000", weight=4)
Arguments
| Name | Required | Default | Description |
|---|---|---|---|
x | yes | - | x-coordinate of the center |
y | yes | - | y-coordinate of the center |
radius | yes | - | Radius of the circle |
stroke | - | - | Stroke color |
fill | - | - | Fill color |
weight | - | - | 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("circle.png");
