Skip to content

textmode.synth.js / SynthSource / charColor

Method: charColor()

Call Signature

ts
charColor(source): this;

Set the character foreground color using a color source chain.

Parameters

ParameterTypeDescription
sourceSynthSourceA SynthSource producing color values, or RGBA values

Returns

this

The SynthSource for chaining

Example

Call Signature

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

Set the character foreground color using RGBA values.

Parameters

ParameterTypeDescription
rSynthParameterValueRed channel (0-1) or value
g?SynthParameterValueGreen channel (0-1) or value
b?SynthParameterValueBlue channel (0-1) or value
a?SynthParameterValueAlpha channel (0-1) or value

Returns

this

The SynthSource for chaining

Example

Call Signature

ts
charColor(gray): this;

Set the character foreground color using a grayscale value.

Parameters

ParameterTypeDescription
graySynthParameterValueGrayscale value (0-1)

Returns

this

Example