Skip to content

textmode.js / media / TextmodeSource / charColor

Method: charColor()

ts
charColor(
   colorOrGray, 
   g?, 
   b?, 
   a?): this;

Set the character color used when charColorMode is 'fixed'.

Parameters

ParameterTypeDescription
colorOrGray| string | number | TextmodeColorA grayscale value (0-255), hex string ('#RGB', '#RRGGBB', '#RRGGBBAA'), or TextmodeColor instance
g?numberOptional green component (0-255) if using RGB format, or alpha (0-255) when using grayscale form
b?numberOptional blue component (0-255) if using RGB format
a?numberOptional alpha component (0-255) if using RGBA format

Returns

this

This instance for chaining.

Example