Skip to content

Documentation / @finchart/core / index / LINEAR_GRADIENT

Variable: LINEAR_GRADIENT ​

const LINEAR_GRADIENT: "charts/linear-gradient" = "charts/linear-gradient"

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

A linear-gradient fill — the first first-class primitive to travel through the custom door.

Why ShapeParams.fill isn't widened to string | gradient: every replay surface that reads fill and assigns it to fillStyle would break at once. Sending it through the custom door means a surface that knows it (the core canvas renderer knows it by default) draws the gradient, and a surface that doesn't demotes to the fallback's flat color — the picture doesn't get a hole in it.