Style class for describing a solid fill color.

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

Properties of SolidFill:

SolidFill Usage:

Use SolidFill with:

 // Example, style points fill with solid red color.
PointSeries.setPointFillStyle(new SolidFill({
color: ColorRGBA( 255, 0, 0 )
}))
  • Creating a SolidLine, or other line style, which can be used for styling a stroke, or border.

Watch out! A common misuse is to attempt styling strokes or borders directly using fill style or color. Remember, when calling a setStrokeStyle method, a line style is expected! Carefully observe the order of wrapped styles: line style <- fill style <- color

 // Example, style line series stroke with solid red line.
LineSeries.setStrokeStyle(new SolidLine({
thickness: 1,
fillStyle: new SolidFill({ color: ColorRGBA( 255, 0, 0 ) })
}))

Related information:

For more fill styles, see:

Hierarchy

Constructors

Properties

Methods

Constructors

  • Construct a SolidFill object, specifying any amount of its properties.

     // Example using RGBA color factory.
    const solidRed = new SolidFill({
    color: ColorRGBA( 255, 0, 0 )
    })
     // Example using HEX color factory.
    const solidRed = new SolidFill({
    color: ColorHEX( '#ff0000' )
    })

    Parameters

    Returns SolidFill

Properties

color: Color

For SolidFill: Color which is used to fill shape.

For IndividualPointFill: Fallback Color for filling shape if individual Color was not given.

For PalettedFill: Fallback Color for filling shape if palette was not given.

fillType: "image" | "solid" | "radial-gradient" | "linear-gradient" | "individual" | "palette"
type: "fillstyle"

Methods

  • Get color of SolidFill.

    Returns

    Color object

    Returns Color

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

    Returns

    New SolidFill object

    Parameters

    • alpha: number

      Value of Alpha channel [0-255]

    Returns SolidFill

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

    Returns

    New SolidFill object

    Parameters

    • blue: number

      Value of Blue channel [0-255]

    Returns SolidFill

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

    Example:

    // specify new color
    solidfill.setColor( ColorHEX('#F00') )

    // change individual color properties
    solidfill.setColor( color => color.setA(80) )

    Returns

    New SolidFill object

    Parameters

    Returns SolidFill

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

    Returns

    New SolidFill object

    Parameters

    • green: number

      Value of Green channel [0-255]

    Returns SolidFill

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

    Returns

    New SolidFill object

    Parameters

    • red: number

    Returns SolidFill