bash-prompt-generator
bash-prompt-generator copied to clipboard
Suggestion: add RGB color support
Even though my terminal reports that it's xterm-256color
, it supports RGB TrueColor. Every modern terminal I've tested with do as well. The format is similar to what you're already using. You could just add a color picker wheel and you'd be done.
The syntax is
\e[<attr>;<fg|bg>;2;<rrr>;<ggg>;<bbb>mHello, world\e[0m
Where:
-
attr
is the normal/bold/emphasis, etc. -
fg
is 38,bg
is 48 (to set default fg or bg, use 39 and 49, and omit the colors) - 2 is the RGB color mode
-
<rrr>;<ggg>;<bbb>
is an RGB tuple:80;201;45
You can also chain foreground and background commands together:
\e[0;38;2;80;201;45;48;2;0;0;0\0m
This is example random (literally) colors in RGB mode from my logging library: