ellipse
Draw an ellipse
ellipse(
x,
y,
w,
h,
[stroke=#000000],
[fill=#FFFFFF],
[weight=1.00]
)
Draw an ellipse
Syntaxe
ellipse(x=10, y=10, w=50, h=100, 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 | |
w | yes | - | width of the ellipse | |
h | yes | - | height of the ellipse | |
stroke | - | #000000 | Stroke color | |
fill | - | #FFFFFF | Fill color | |
weight | - | 1.00 | Stroke weight (thickness) |
Full example
var palette = palette_blend("#C74538", "#4DD0E1", 10);
var cycle = 3;
canvas(800, 800, "#37474F", 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*2; 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(whoami(png=true));
