# 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 create with:

const stop = parentElement.add('stop')

It's possible create as a disconnected element with gySVG('stop') and attach it to the SVG document with .attachTo().

More info: mdn (opens new window) | w3c (opens new window)

# .stop-color()

stop.stop-color( _ )

Set this attribute defines the color of the gradient stop. It can be used as a CSS property.

  • argument: {} _

  • returns: {gySVGObject} The original object

const stop-color = element.stop-color();

Get the stop-color current value.

  • returns: {}

# .stop-opacity()

stop.stop-opacity( _ )

Set this attribute defines the opacity of the gradient stop. It can be used as a CSS property.

  • argument: {} _

  • returns: {gySVGObject} The original object

const stop-opacity = element.stop-opacity();

Get the stop-opacity current value.