palette_blend
palette_blend(from, to, values) -> List of <values> colors
Returns a slice of interpolated colors, blended between two colors, including colors from/to
Syntaxe
var col = palette_blend(from="#FFC107", to="#000", values=10)
Arguments
| Name | Required | Default | Description |
|---|---|---|---|
from | yes | - | Color from |
to | yes | - | Color to |
values | yes | - | Numbers of colors, 3 mins |
Full example
canvas(width=1150, height=100);
var from = "#FFC107";
var to = "#1976D2";
var col = palette_blend(from=from, to=to, values=19);
circle(x= 50, y=25, radius=40, fill=from);
circle(x= 50, y=75, radius=40, fill=to);
for (var i=0; i<col.length; i++) {
circle(x=200+i*50, y=50, radius=40, fill=col[i]);
}
arrow(x=150, y=45, rotation=0.5, length=50, shaft=10, head=25, position=true);
arrow(x=150, y=55, rotation=-0.5, length=50, shaft=10, head=25, position=true);
save("palette_blend.png");
