ellipse
ellipse(x, y, w, h, [stroke], [fill], [weight])
Draw an ellipse
Syntaxe
ellipse(x=10, y=10, w=50, h=100, 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 |
w | yes | - | width of the ellipse |
h | yes | - | height of the ellipse |
stroke | - | - | Stroke color |
fill | - | - | Fill color |
weight | - | - | Stroke weight (thickness) |
Full example
var palette = palette_blend("#C74538", "#4C8691", 10);
var cycle = 3;
canvas(800, 800, "#020410", center=true);
var padding = 20;
var x = 0;
var y = 0;
var radius = height()/2 - padding;
fill("transparent");
weight(2);
var col = 0;
var totalRings = length(palette) * cycle;
for (var j = cycle; j < totalRings-cycle; j++) {
var currentRadius = radius - j * (radius / totalRings);
stroke(palette[j % length(palette)]);
ellipse(x, y, radius, currentRadius);
ellipse(x, y, currentRadius, radius);
}
save("ellipse.png");
