Skip to content

ansi::color

color(input: String, colorName: String)

ParameterTypeDescription
inputStringText that should be colored
colorNameStringColor name. One of: default, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, etc.

Returns

(String) A string containing ansi escape codes that result in colored text in the terminal.