TESTER

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

NameRequiredDefaultDescription
xyes-x-coordinate of the center
yyes-y-coordinate of the center
radiusyes-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");