Fills an area with a specified solid color.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.SolidColorFill
Constructors
Initializes a new instance of the SolidColorFill class with the specified color.
Initializes a new instance of the SolidColorFill class with the specified RGBA values.
Remarks
All values must be between 0 and 255.
New instances of this type are automatically frozen since they are immutable anyway.
Parameters
A map of options to pass to the method.
- r - number
- The red value.
- g - number
- The green value.
- b - number
- The blue value.
- a - number
- The alpha value, 255 by default.
Properties
Gets the solid color of this fill.
Methods
Assigns the fill defined by this instance to the given SVG element
.
Remarks
If this Fill is a gradient and implements the ISvgDefsCreator interface, it will be added to the defs
section of the SVG document per the context
. The fill of the given element will be set to a reference to the gradient element.
This method is very similar in functionality to its static method counter part setFill. However since this method is an instance method, it cannot be called on empty/null
fills. If you are unsure whether the reference actually points to an instance, use the static helper method instead.
Parameters
A map of options to pass to the method.
- element - SVGElement
- The element whose fill should be set.
- context - ICanvasContext
- The context.
See Also
Defined in
Clones this instance by returning a memberwiseClone or this in case this instance is already frozen.
Freezes and returns this instance.
Determines whether this SolidColorFill is equal to the specified object.
Parameters
A map of options to pass to the method.
Returns
- ↪boolean
Implements
Determines if this instance is frozen.