textmode.js / Textmodifier / fill
Method: fill()
Call Signature
ts
fill(): TextmodeColor;Alias for cellColor. Current fill (cell background) color.
Returns
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
| Parameter | Type | Description |
|---|---|---|
gray | number | Grayscale value (0-255) |
alpha? | number | Optional 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
| Parameter | Type | Description |
|---|---|---|
r | number | Red component (0-255) |
g | number | Green component (0-255) |
b | number | Blue component (0-255) |
a? | number | Optional 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
| Parameter | Type | Description |
|---|---|---|
value | | string | TextmodeColor | Hex string, rgb()/rgba() string, or an existing color object |
Returns
void