Color code:
Format: echo "\033[word background color; font Color m string \033[0m" for example: echo "\033[41;36m something here \033[0m" where 41 of the position represents the background, 36 of the position is the color that represents the word, those ASCII code Is the whole story of the color call. \033[, M. ... \033[0m Word background color range:----4940: Black 41: Crimson 42: Green 43: Yellow 44: Blue 45: Purple 46: Dark green 47: White word color: 3930: Black 31: Red 32: Green 33: Yellow 34: Blue 35: Purple 36: Dark green 37: Description of the white ===============================================ansi control code \33[0m Close all properties \33[1m set high brightness \33[4m underline \33[ 5m flashing \33[7m \33[8m blanking \33[30m--\33[37m setting foreground color \33[40m--\33[47m setting background color \33[na cursor up n rows \33[nb cursor down n lines \33[nc cursor right shift n rows \33[ ND cursor left n line \33[y;xh set cursor position \33[2j Clear Screen \33[k clear the contents from cursor to end of line \33[s save cursor position \33[u restore cursor position \33[?25l Hide cursor \33[?25h display cursor
Instance:
#include <stdio.h>int main (int Argc,char **argv) { printf ("\033[31m the ... \n\033[0m"); printf ("\033[2;7;1mheoo.\n\033[2;7;0m"); printf ("\033[41;36msomthe here\n\033[0m"); return 0;}
The Linux Terminal program uses C language to change the color of the output word