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' )
})
Object containing any amount of SolidFill properties.
Get color of SolidFill.
Color object
Get automatically computed highlight style.
FillStyle object
Construct a new SolidFill object based on this one, but with a modified Alpha value.
Value of Alpha channel [0-255]
New SolidFill object
Construct a new SolidFill object based on this one, but with a modified Blue value.
Value of Blue channel [0-255]
New SolidFill object
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) )
Either a Color object or a function, which will be used to create a new Color based on current value.
New SolidFill object
Construct a new SolidFill object based on this one, but with a modified Green value.
Value of Green channel [0-255]
New SolidFill object
Construct a new SolidFill object based on this one, but with a modified Red value.
New SolidFill object
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.
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:
color
: fill color. Construct a LCJS color using one of the many available factories:SolidFill Usage:
Use SolidFill with:
setFillStyle
methods:// Example, style points fill with solid red color. PointSeries.setPointFillStyle(new SolidFill({ color: ColorRGBA( 255, 0, 0 ) }))
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: