textmode.js / Textmodifier / colorMode
Method: colorMode()
Call Signature
ts
colorMode(): TextmodeColorModeState;Current color interpretation mode.
Returns
Current color mode and channel maxes.
Example
Call Signature
ts
colorMode(mode, max?): void;Set how numeric color inputs are interpreted.
Supported modes are 'rgb', 'hsb', and 'hsl'. Passing one max uses that range for all channels. Passing per-channel maxes uses maxA for alpha, defaulting to the selected mode's alpha max.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | TextmodeColorMode | Color mode to use for numeric colors. |
max? | number | Shared channel max. |
Returns
void
Example
Call Signature
ts
colorMode(
mode,
max1,
max2,
max3,
maxA?): void;Set how numeric color inputs are interpreted with per-channel ranges.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | TextmodeColorMode | Color mode to use for numeric colors. |
max1 | number | Red or hue max. |
max2 | number | Green or saturation max. |
max3 | number | Blue, brightness, or lightness max. |
maxA? | number | Alpha max. |
Returns
void