Skip to content

textmode.synth.js / SynthSource / paint

Method: paint()

Call Signature

ts
paint(source): this;

Set both character foreground and cell background color using the same source chain. This is a convenience method that combines .charColor() and .cellColor() in one call.

After calling paint(), you can still override the cell color separately using .cellColor().

Otherwise useful for pixel art styles where both colors are the same, making the characters redundant.

Parameters

ParameterTypeDescription
sourceSynthSourceA SynthSource producing color values

Returns

this

The SynthSource for chaining

Example

Call Signature

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

Set both character foreground and cell background 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
paint(gray): this;

Set both character foreground and cell background color using a grayscale value.

Parameters

ParameterTypeDescription
graySynthParameterValueGrayscale value (0-1)

Returns

this

Example