# radialGradient

The radialGradient element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.

Usually, this element is create with:

const radialGradient = parentElement.add('radialGradient')

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

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

# .cx()

radialGradient.cx( _ )

Set this attribute defines the x coordinate of the end circle of the radial gradient.

  • argument: {} _

  • returns: {gySVGObject} The original object

const cx = element.cx();

Get the cx current value.

  • returns: {}

# .cy()

radialGradient.cy( _ )

Set this attribute defines the y coordinate of the end circle of the radial gradient.

  • argument: {} _

  • returns: {gySVGObject} The original object

const cy = element.cy();

Get the cy current value.

  • returns: {}

# .fr()

radialGradient.fr( _ )

Set this attribute defines the radius of the start circle of the radial gradient. The gradient will be drawn such that the 0% stop is mapped to the perimeter of the start circle.

  • argument: {} _

  • returns: {gySVGObject} The original object

const fr = element.fr();

Get the fr current value.

  • returns: {}

# .fx()

radialGradient.fx( _ )

Set this attribute defines the x coordinate of the start circle of the radial gradient.

  • argument: {} _

  • returns: {gySVGObject} The original object

const fx = element.fx();

Get the fx current value.

  • returns: {}

# .fy()

radialGradient.fy( _ )

Set this attribute defines the y coordinate of the start circle of the radial gradient.

  • argument: {} _

  • returns: {gySVGObject} The original object

const fy = element.fy();

Get the fy current value.

  • returns: {}

# .gradientUnits()

radialGradient.gradientUnits( _ )

Set this attribute defines the coordinate system for attributes x1, x2, y1, y2

  • argument: {} _

  • returns: {gySVGObject} The original object

const gradientUnits = element.gradientUnits();

Get the gradientUnits current value.

  • returns: {}

# .gradientTransform()

radialGradient.gradientTransform( _ )

Set this attribute provides additional transformation to the gradient coordinate system.

  • argument: {} _

  • returns: {gySVGObject} The original object

const gradientTransform = element.gradientTransform();

Get the gradientTransform current value.

  • returns: {}

# .href()

radialGradient.href( _ )

Set this attribute defines a reference to another linearGradient element that will be used as a template.

  • argument: {} _

  • returns: {gySVGObject} The original object

const href = element.href();

Get the href current value.

  • returns: {}

# .r()

radialGradient.r( _ )

Set this attribute defines the radius of the end circle of the radial gradient. The gradient will be drawn such that the 100% stop is mapped to the perimeter of the end circle.

  • argument: {} _

  • returns: {gySVGObject} The original object

const r = element.r();

Get the r current value.

  • returns: {}

# .spreadMethod()

radialGradient.spreadMethod( _ )

Set this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient.

  • argument: {} _

  • returns: {gySVGObject} The original object

const spreadMethod = element.spreadMethod();

Get the spreadMethod current value.