SVGGradient¶
Overview¶
Base type for controllers that create and keep an SVG gradient element up-to-date with a Scenery gradient.
@author Jonathan Olson <jonathan.olson@colorado.edu>
Class SVGGradient¶
Constructor¶
new SVGGradient( svgBlock : SVGBlock, gradient : Gradient )¶
Instance Methods¶
isActiveSVGGradient() : this is ActiveSVGGradient¶
initialize( svgBlock : SVGBlock, gradient : Gradient )¶
createDefinition() : SVGGradientElement¶
(protected)
Creates the gradient-type-specific definition.
markDirty()¶
Called from SVGGradientStop when a stop needs to change the actual color.
update()¶
Called from SVGBlock when we need to update our color stops.
dispose()¶
Disposes, so that it can be reused from the pool.
freeToPool()¶
Instance Properties¶
gradient : Gradient | null¶
stops : SVGGradientStop[]¶
definition : SVGGradientElement¶
persistent
Type ActiveSVGGradient¶
WithoutNull<SVGGradient, "svgBlock" | "gradient">
Source Code¶
See the source for SVGGradient.ts in the scenery repository.