Closed squoddam closed 1 month ago
Currently fill property, defined in ShapeConfig, only allows for strings to be passed. But despite that it is actually possible to pass CanvasGradient to the fill, and it renders correctly (codesandbox demo)
fill
ShapeConfig
CanvasGradient
This PR adds CanvasGradient as one of possible values of fill, the same way it is done for stroke: https://github.com/konvajs/konva/blob/68b4ea3cb65f7ebd838f7e420958d26b59088f0f/src/Shape.ts#L60
stroke
Good. Can you also update the shape.fill() method type?
shape.fill()
Thanks. I will make a release a bit later.
Currently
fill
property, defined inShapeConfig
, only allows for strings to be passed. But despite that it is actually possible to passCanvasGradient
to thefill
, and it renders correctly (codesandbox demo)This PR adds
CanvasGradient
as one of possible values offill
, the same way it is done forstroke
: https://github.com/konvajs/konva/blob/68b4ea3cb65f7ebd838f7e420958d26b59088f0f/src/Shape.ts#L60