Skip to content

Documentation / @finchart/core / index / fillLinearGradient

Function: fillLinearGradient() ​

fillLinearGradient(target, params): void

Defined in: packages/core/src/render/gradient.ts:50

Sends out a request to fill a polygon with a gradient.

Passing through this function automatically loads a fallback — the first stop's flat color. Demoting to "a flat fill in the top color" on a surface that doesn't know gradients beats not drawing at all, and the fallback is only trustworthy if you can predict which color it'll be.

Parameters ​

target ​

DrawTarget

params ​

LinearGradientParams

Returns ​

void