Documentation / @ripl/terminal / colorToAnsiBg
Function: colorToAnsiBg() ​
colorToAnsiBg(
color,opacity?):string|undefined
Defined in: terminal/src/color.ts:152
Converts a CSS color string to an ANSI truecolor background escape sequence. Resolution and return values match colorToAnsiFg.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
color | string | undefined | The paint to resolve. |
opacity | number | 1 | Additional alpha to composite over the paint's own. Defaults to 1. |
Returns ​
string | undefined
The escape sequence, '' when unresolvable, or undefined when it must not be drawn.