Options
All
  • Public
  • Public/Protected
  • All
Menu

Gradient formed from two circles with their own centers and radius. The coordinates of the circles centers are relative to the canvas' space, not to any control's space.

see

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createRadialGradient

Hierarchy

Index

Constructors

  • new RadialGradient(x0?: number, y0?: number, r0?: number, x1?: number, y1?: number, r1?: number): RadialGradient
  • Creates a new radial gradient

    Parameters

    • Optional x0: number

      x coordinate of the first circle's center

    • Optional y0: number

      y coordinate of the first circle's center

    • Optional r0: number

      radius of the first circle

    • Optional x1: number

      x coordinate of the second circle's center

    • Optional y1: number

      y coordinate of the second circle's center

    • Optional r1: number

      radius of the second circle

    Returns RadialGradient

Accessors

  • Color stops of the gradient

    Returns GradientColorStop[]

  • get r0(): number
  • radius of the first circle

    Returns number

  • get r1(): number
  • radius of the second circle

    Returns number

  • get x0(): number
  • x coordinate of the first circle's center

    Returns number

  • get x1(): number
  • x coordinate of the second circle's center

    Returns number

  • get y0(): number
  • y coordinate of the first circle's center

    Returns number

  • get y1(): number
  • y coordinate of the second circle's center

    Returns number

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
  • Class name of the gradient

    Returns string

    the class name of the gradient

  • parse(serializationObject: any): void
  • Parses a gradient from a serialization object

    Parameters

    • serializationObject: any

      the object to parse from

    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
  • Serializes this gradient

    Parameters

    • serializationObject: any

      the object to serialize to

    Returns void

Legend

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

Settings

Theme