Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SolidFill

Class for specifying fill style with a single, solid Color.

Instances of SolidFill are immutable, meaning that its setters don't modify the object, but instead return a completely new modified object.

When creating a new SolidFill object from scratch, parameters can be passed like follows:

  • new SolidFill({ color: ColorHEX('#F00') })

Index

Constructors

constructor

  • When creating a new SolidFill object from scratch, the parameters can be passed like follows:

    • new SolidFill({ color: ColorHEX('#F00') })

    Parameters

    • Optional props: Partial<FillStyleProperties>

      Optional object containing parameters for creation of SolidFill

    Returns SolidFill

Methods

getColor

  • Get color of SolidFill.

    Returns Color

    Color object

getDefaultHighlightStyle

  • getDefaultHighlightStyle(): this
  • Get automatically computed highlight style.

    Returns this

    FillStyle object

setA

  • Construct a new SolidFill object based on this one, but with a modified Alpha value.

    Parameters

    • alpha: number

      Value of Alpha channel [0-255]

    Returns SolidFill

    New SolidFill object

setB

  • Construct a new SolidFill object based on this one, but with a modified Blue value.

    Parameters

    • blue: number

      Value of Blue channel [0-255]

    Returns SolidFill

    New SolidFill object

setColor

  • Construct a new SolidFill object based on this one, but with modified color.

    Example usage:

    Desired result Argument
    Specified Color ColorHex('#F00')
    Changed transparency (color) => color.setA(80)

    Parameters

    • value: Color | ImmutableMutator<Color>

      Either a Color object or a function, which will be used to create a new Color based on current value.

    Returns this

    New SolidFill object

setG

  • Construct a new SolidFill object based on this one, but with a modified Green value.

    Parameters

    • green: number

      Value of Green channel [0-255]

    Returns SolidFill

    New SolidFill object

setR

  • Construct a new SolidFill object based on this one, but with a modified Red value.

    Parameters

    • red: number

    Returns SolidFill

    New SolidFill object

Static Record

  • Record(defaultValues: TProps, name?: undefined | string): Factory<TProps>
  • Unlike other types in Immutable.js, the Record() function creates a new Record Factory, which is a function that creates Record instances.

    See above for examples of using Record().

    Note: Record is a factory function and not a class, and does not use the new keyword during construction.

    Type parameters

    • TProps

    Parameters

    • defaultValues: TProps
    • Optional name: undefined | string

    Returns Factory<TProps>