API

Class BaseGradientAbstract

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

Hierarchy (View Summary)

Index
  • 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

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

    Parameters

    • context: ICanvasRenderingContext

      the context to create the gradient from

    Returns CanvasGradient

    the canvas gradient