The string to style.
The desired color; hex code or name.
The ANSI-wrapped text with a foreground color and reset suffix.
color (hex like #rrggbb, #rgb, or named color) via safeParseColor.
If parsing fails, it falls back to white.\u001b[38;2;r;g;bm.
Terminates the colored portion with ANSI_RESET to avoid bleeding styles.rgbToAnsi.color("Error", "#ff0000"); // red text
color("Info", "invalid-color"); // falls back to white text
https://en.wikipedia.org/wiki/ANSI_escape_code — ANSI escape SGR parameters like 38;2;….
Wrap text with an ANSI foreground color escape sequence.