Skip to content

textmode.js / Textmodifier / fill

Method: fill()

Call Signature

ts
fill(): TextmodeColor;

Alias for cellColor. Current fill (cell background) color.

Returns

TextmodeColor

Current cell color.

Example

Call Signature

ts
fill(gray, alpha?): void;

Alias for cellColor. Set the fill (cell background) color using a grayscale value.

Parameters

ParameterTypeDescription
graynumberGrayscale value (0-255)
alpha?numberOptional alpha value (0-255)

Returns

void

Example

Call Signature

ts
fill(
   r, 
   g, 
   b, 
   a?): void;

Alias for cellColor. Set the fill (cell background) color using RGB(A) values.

Parameters

ParameterTypeDescription
rnumberRed component (0-255)
gnumberGreen component (0-255)
bnumberBlue component (0-255)
a?numberOptional alpha component (0-255)

Returns

void

Example

Call Signature

ts
fill(value): void;

Alias for cellColor. Set the fill (cell background) color using a CSS string or TextmodeColor object.

Parameters

ParameterTypeDescription
value| string | TextmodeColorHex string, rgb()/rgba() string, or an existing color object

Returns

void

Example