User Tools

Site Tools


bash:colors:24-bit_rgb_colors

This is an old revision of the document!


BASH - Colors - 24-bit RGB Colors

Format

\033[38;2;R;G;B

where:

  • R is RED; values 0 to 255.
  • R is BLUE; values 0 to 255.
  • R is GREEN; values 0 to 255.

RED Example

echo -e "\033[38;2;155;0;0mThis is in RED"

ANSI Rainbow

for (( r = 0; r < 255; r++ )); do for (( g = 0; g < 255; g++ )); do for (( b = 0; b < 255; b++ )); do echo -e "\033[38;2;"$r";"$g";"$b"mHello $r $g $b"; done done done

bash/colors/24-bit_rgb_colors.1610197914.txt.gz · Last modified: 2021/01/09 13:11 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki