linearGradient

fun linearGradient(vararg colorStops: Pair<Float, Color>, start: Point2D, end: Point2D): Brush

A gradient running from start to end, both relative to the decorated box's top-left corner, so it stays where it is declared whatever size the box takes.

Return

the gradient brush.

Parameters

colorStops

where each color sits between start and end, as a fraction from 0f to 1f; at least one stop is required.

start

where the first stop sits relative to the decorated box's top-left corner.

end

where the last stop sits relative to the decorated box's top-left corner.

See also