textmode.synth.js / SynthSource / color
Method: color()
Call Signature
ts
color(gray): this;Multiply all channels by a scalar value (grayscale).
Parameters
| Parameter | Type | Description |
|---|---|---|
gray | SynthParameterValue | Scalar multiplier |
Returns
this
Example
Call Signature
ts
color(
r?,
g?,
b?,
a?): this;Colorize a grayscale source or multiply an existing color source.
This is the recommended way to add color to grayscale sources like osc(), noise(), or voronoi().
Parameters
| Parameter | Type | Description |
|---|---|---|
r? | SynthParameterValue | Red channel multiplier (default: 1.0) |
g? | SynthParameterValue | Green channel multiplier (default: 1.0) |
b? | SynthParameterValue | Blue channel multiplier (default: 1.0) |
a? | SynthParameterValue | Alpha channel multiplier (default: 1.0) |
Returns
this