Skip to content

textmode.js / Textmodifier / charColor

Method: charColor()

Call Signature

ts
charColor(): TextmodeColor;

Current character color.

Returns

TextmodeColor

Current character color.

Example

Call Signature

ts
charColor(gray, alpha?): void;

Set the character color using a grayscale value.

Parameters

ParameterTypeDescription
graynumberGrayscale value (0-255)
alpha?numberOptional alpha value (0-255)

Returns

void

Example

Call Signature

ts
charColor(
   r, 
   g, 
   b, 
   a?): void;

Set the character color using RGB(A) values.

Parameters

ParameterTypeDescription
rnumberRed component (0-255)
gnumberGreen component (0-255)
bnumberBlue component (0-255)
a?numberOptional alpha component (0-255)

Returns

void

Example

Call Signature

ts
charColor(value): void;

Set the character color using a CSS string or TextmodeColor object.

Parameters

ParameterTypeDescription
value| string | TextmodeColorHex string, rgb()/rgba() string, or an existing color object

Returns

void

Example