ColorPlugin
Hierarchy
- MetadataPlugin
- ColorPlugin
Index
Constructors
constructor
Returns ColorPlugin
Properties
readonlyname
The name of the plugin.
Methods
fromJSON
Parses the color value from a JSON string or object.
Parameters
value: string | object
The JSON value.
Returns number
The numeric representation of the color.
getColor
Converts a color name or value into its numeric representation.
Parameters
value: string | number
The color value (name, string, or number).
Returns number
The numeric representation of the color.
getTrait
Retrieves the trait representation of the color value.
Parameters
params: { key: string; type: string; value: string | number }
The parameters including key, type, and value.
key: string
type: string
value: string | number
Returns { canonicalRepresentation: number; key: Field; value: MetadataValue }
An object containing the key, value, and canonical representation.
canonicalRepresentation: number
key: Field
value: MetadataValue
toJSON
Converts the color value to a JSON string.
Parameters
value: string | number
The color value.
Returns string
The JSON string representation.
A plugin for handling color metadata.