ANSI Color Specific RGB Sequence Bash

前端 未结 5 1647
孤街浪徒
孤街浪徒 2020-12-04 08:56

I know that in bash terminals a reliable way to change color is using ANSI escape sequences. For example:

echo -e \"\\033[0;31mbrown text\\033[0;00m\"
         


        
5条回答
  •  失恋的感觉
    2020-12-04 09:28

    This will work

    echo -e "**\033[38;2;255;0;0m**red text\033[0;00m"
    

    format: "\033[38;2;R;G;Bm"

    • R is your RED component of your RGB
    • G is your GRREN component of your RGB
    • B is your BLUE component of your RGB

提交回复
热议问题