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
| Parameter | Type | Description |
|---|---|---|
source | SynthSource | A 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
| Parameter | Type | Description |
|---|---|---|
r | SynthParameterValue | Red channel (0-1) or value |
g? | SynthParameterValue | Green channel (0-1) or value |
b? | SynthParameterValue | Blue channel (0-1) or value |
a? | SynthParameterValue | Alpha 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
| Parameter | Type | Description |
|---|---|---|
gray | SynthParameterValue | Grayscale value (0-1) |
Returns
this