toFormat(
(format: ColorFormat
)): Color | Converts the color to the given color format, and returns a new Color object. |
toHexInt(): number | Converts the color to hex, and returns an integer representation. |
getChannelValue(
(channel: ColorChannel
)): number | Returns the numeric value for a given channel.
Throws an error if the channel is unsupported in the current color format. |
withChannelValue(
(channel: ColorChannel,
, value: number
)): Color | Sets the numeric value for a given channel, and returns a new Color object.
Throws an error if the channel is unsupported in the current color format. |
getChannelRange(
(channel: ColorChannel
)): ColorChannelRange | Returns the minimum, maximum, and step values for a given channel. |
getChannelName(
(channel: ColorChannel,
, locale: string
)): string | Returns a localized color channel name for a given channel and locale,
for use in visual or accessibility labels. |
formatChannelValue(
(channel: ColorChannel,
, locale: string
)): string | Formats the numeric value for a given channel for display according to the provided locale. |