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' )
})
Optional
props: Partial<VisibleFillStyleProperties>Object containing any amount of SolidFill properties.
Readonly
colorFor 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.
Readonly
typeConstruct 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) )
New SolidFill object
Either a Color object or a function, which will be used to create a new Color based on current value.
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: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 <- colorRelated information:
For more fill styles, see: