Class LinearGradient

Abstraction of a Gradient or Texture.

Hierarchy (view full)

Implements

Constructors

  • Parameters

    • point1: VectorLike

      The position of the first end point of the linear gradient.

    • point2: VectorLike

      The position of the second end point of the linear gradient.

    • stops: (Stop | [offset: number, color: string, opacity: number])[]

      A list of Stops that contain the gradient fill pattern for the gradient. The linear gradient lives within the space of the parent object's matrix space.

    • Optionaloptions: LinearGradientOptions

    Returns LinearGradient

Properties

_flagStops: boolean
parent: unknown
zzz: ZZZ

Accessors

  • get id(): string
  • Returns string

  • set id(id): void
  • Parameters

    • id: string

    Returns void

  • get point1(): G20
  • Returns G20

  • set point1(point1): void
  • Parameters

    Returns void

  • get point2(): G20
  • Returns G20

  • set point2(point2): void
  • Parameters

    Returns void

  • get spreadMethod(): "pad" | "reflect" | "repeat"
  • Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.

    Returns "pad" | "reflect" | "repeat"

  • set spreadMethod(spread): void
  • Parameters

    • spread: "pad" | "reflect" | "repeat"

    Returns void

  • get stops(): Stop[]
  • Returns Stop[]

  • set stops(stops): void
  • Parameters

    Returns void

  • get units(): "userSpaceOnUse" | "objectBoundingBox"
  • Indicates how coordinate values are interpreted by the renderer.

    Returns "userSpaceOnUse" | "objectBoundingBox"

  • set units(units): void
  • Parameters

    • units: "userSpaceOnUse" | "objectBoundingBox"

    Returns void

Methods

  • Indicates to the ColorProvider that it is being used in one less fill or stroke property. The ColorProvider is expected to remove itself from the SVG defs element when no longer used.

    Type Parameters

    • T

    Parameters

    Returns void

  • Returns void

  • Parameters

    • OptionaldirtyFlag: boolean

    Returns this

  • Indicates to the ColorProvider that it is being used in one more fill or stroke property. The ColorProvider is expected to add itself to the SVG defs element when being used.

    Type Parameters

    • T

    Parameters

    Returns void

  • Type Parameters

    • T

    Parameters

    Returns this

  • Provide the value that will be used in the fill or stroke attribute of the consuming element. Usually url(#${this.id}) for gradients and textures but may be e.g. an rgb() or #RRGGBB value.

    Returns string

  • Returns this