Skip to content

textmode.synth.js / solid

Function: solid()

Call Signature

ts
function solid(gray): SynthSource;

Generate a solid grayscale color.

Parameters

ParameterTypeDescription
graySynthParameterValueGrayscale value (0-1)

Returns

SynthSource

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(solid(0.4).char(osc(6, 0.1, 1.2)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});
codex avatar
@codex{ai-generated}Replace it with your own sketch, claim the credit, and climb the leaderboard.View sketch on GitHub

Call Signature

ts
function solid(
   r?, 
   g?, 
   b?, 
   a?): SynthSource;

Generate a solid color.

Parameters

ParameterTypeDescription
r?SynthParameterValueRed channel (0-1, default: 0.0)
g?SynthParameterValueGreen channel (0-1, default: 0.0)
b?SynthParameterValueBlue channel (0-1, default: 0.0)
a?SynthParameterValueAlpha channel (0-1, default: 1.0)

Returns

SynthSource

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(solid(0.1, 0.2, 0.5, 1).char(noise(8)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});
codex avatar
@codex{ai-generated}Replace it with your own sketch, claim the credit, and climb the leaderboard.View sketch on GitHub