Dynamic Icons Scripting Reference - v1.3.0
    Preparing search index...

    Class BrushStyle

    Class for storing a fill or stroke style to use on a Canvas context.

    Index

    Accessors

    • get isNull(): boolean

      Returns true if color string is empty and gradient/pattern/texture are all null.

      Returns boolean

    • get isEmpty(): boolean

      Returns true if isNull is true OR a solid color represents a transparent color.

      Returns boolean

    • get color(): string

      Returns any color previously set on the color property, if any (default is an empty string).

      Returns string

    • set color(v: string): void

      Set brush style as a solid color.

      Input value must be a format accepted by CanvasRenderingContext2D fillStyle and strokeStyle properties: a CSS named color, #RGB[A] hex values, rgb[a](r g b [/ a]), hsl[a](h s l [/ a]), or hwb(h w b [/ a])

      Setting a color will override all other styles (even if it is empty or transparent).

      Parameters

      • v: string

      Returns void

    • get pattern(): null | CanvasPattern

      Specifies a pattern to use for the drawing style. Setting a pattern will override all other styles (even if it is null).

      Returns null | CanvasPattern

    • set pattern(v: null | CanvasPattern): void

      Parameters

      Returns void

    • get texture(): null | CanvasTexture

      Specifies a texture to use for the drawing style. Setting a texture will override all other styles (even if it is null).

      Returns null | CanvasTexture

    • set texture(v: null | CanvasTexture): void

      Parameters

      • v: null | CanvasTexture

      Returns void

    Constructors

    Methods

    • Applies the current style property to the given ctx as a fillStyle, or strokeStyle if asFill is set to false. If the current isNull property returns true then no styles are applied.

      Parameters

      Returns void