Skip to content

textmode.synth.js / SynthSource / color

Method: color()

Call Signature

ts
color(gray): this;

Multiply all channels by a scalar value (grayscale).

Parameters

ParameterTypeDescription
graySynthParameterValueScalar 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

ParameterTypeDescription
r?SynthParameterValueRed channel multiplier (default: 1.0)
g?SynthParameterValueGreen channel multiplier (default: 1.0)
b?SynthParameterValueBlue channel multiplier (default: 1.0)
a?SynthParameterValueAlpha channel multiplier (default: 1.0)

Returns

this

Example