Options
All
  • Public
  • Public/Protected
  • All
Menu

Class that serves as a base for all the gradients created from context.

Hierarchy

Index

Constructors

Accessors

  • Color stops of the gradient

    Returns GradientColorStop[]

Methods

  • addColorStop(offset: number, color: string): void
  • Adds a new color stop to the gradient.

    Parameters

    • offset: number

      the offset of the stop on the gradient. Should be between 0 and 1

    • color: string

      the color of the stop

    Returns void

  • clearColorStops(): void
  • Removes all color stops from the gradient

    Returns void

  • If there are any changes or the context changed, regenerate the canvas gradient object. Else, reuse the existing gradient.

    Parameters

    Returns CanvasGradient

  • getClassName(): string
  • Type of the gradient

    Returns string

  • parse(serializationObject: any): void
  • Parse from json object

    Parameters

    • serializationObject: any

    Returns void

  • removeColorStop(offset: number): void
  • Removes an existing color stop with the specified offset from the gradient

    Parameters

    • offset: number

      the offset of the stop to be removed

    Returns void

  • serialize(serializationObject: any): void
  • Serialize into a json object

    Parameters

    • serializationObject: any

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme