TESTER

color_darker

color_darker(color, perc) -> Hex color

Returns a darker version of the specified color

Syntaxe

var col = color_darker(color="#FFC107", perc=0.4);

Arguments

NameRequiredDefaultDescription
coloryes-Color
percyes-Percentage (0-1)

Full example

canvas(width=250, height=100);
var base = "#FFC107";

var col = color_darker(color=base, perc=0.4);

circle(x= 50, y=50, radius=40, fill=base);
circle(x=200, y=50, radius=40, fill=col);
arrow(x=150, y=50, rotation=0, length=50, shaft=10, head=25, position=true);
save("color_darker.png");