Skip to content

textmode.js / media / TextmodeImage / background

Method: background()

ts
background(
   colorOrGray, 
   g?, 
   b?, 
   a?): this;

Set the background color used for transparent pixels.

Parameters

ParameterTypeDescription
colorOrGray| string | number | TextmodeColorA grayscale value (0-255), hex string ('#RGB', '#RRGGBB', '#RRGGBBAA'), or TextmodeColor instance
g?numberOptional green component, or alpha when using grayscale form.
b?numberOptional blue component.
a?numberOptional alpha component.

Returns

this

This instance for chaining.

Example

Inherited from

TextmodeSource.background