When creating a new SolidFill object from scratch, the parameters can be passed like follows:
Optional object containing parameters for creation of SolidFill
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 usage:
Desired result | Argument |
---|---|
Specified Color | ColorHex('#F00') |
Changed transparency | (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.
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: