stop
The SVG stop
element defines a color and its position to use on a gradient. This element is always a child of a linearGradient
or radialGradient
element.
Usually, this element is created with:
js
const stop = parentElement.add('stop')
It's possible to create it as a disconnected element with gSVG('stop')
and attach it to the SVG document with .attachTo()
.
.stop-color()
js
stop.stop_color( color )
Set this attribute defines the color of the gradient stop. It can be used as a CSS property.
argument:
{string} color
The color valuereturns:
{gSVGObject}
The original object
js
const stop_color = element.stop_color();
Get the stop-color
current value.
- returns:
{string}
.stop-opacity()
js
stop.stop_opacity( opacity )
Set this attribute defines the opacity of the gradient stop. It can be used as a CSS property.
argument:
{number|string} opacity
The opacity valuereturns:
{gSVGObject}
The original object
js
const stop_opacity = element.stop_opacity();
Get the stop-opacity
current value.