If you mean console, try this ANSI color code in your shell:
The first 1 is intensity; 0 is dark, 1 is bright. The second 1 is color; 1 is red, 2 is green, 4 is blue, 3 is yellow(red plus green), etc. The '\x1b[%i;3%im' sets color, with the %i's replaced by the 1's. The '\x1b[0m' resets the color back to defaults.
It is an ASCII escape sequence, directly telling the terminal to change colors. The printf substitutes paramaters into it. The "\x1b" part actually becomes one single character, ESC. The "%i" bits get substituted with the integers on the commandline by printf. The rest of it's all literal characters, but the console understands it as a "change color" message.
Hi
I'd like to print color text and I've tried this: echo "\033but it didn't woked. When I changed 0 --> 1/4/5, the text "HI" --> bold/underline/blink, but when I changed 31 or 33 to other values, the color didn't change.
What's the problem. Need to install something ??? (8 Replies)
Hi
i want to print the text in different color using perl script.
i am able to print on console(terminal).
but if i try to print the same into a file, i am not able to do
color.pl
#!/bin/usr/perl
use Term::ANSIColor;
print "This text is normal.\n";
use Term::ANSIColor qw(:constants);... (3 Replies)