Skip to content

Documentation / @ripl/terminal / colorToAnsiFg

Function: colorToAnsiFg()

colorToAnsiFg(color): string

Defined in: terminal/src/color.ts:9

Converts a CSS color string to an ANSI truecolor foreground escape sequence. Returns empty string for invalid/transparent colors.

Parameters

ParameterType
colorstring

Returns

string