The Linux Page

Console color: dark blue on black unreadable

As I work in consoles every now and then, I run in that one problem:

Some text is written in Dark Blue over the Black background:

This is a good example of what I'm talking about.

And if you can read that text, wow! (without selecting it first.

So... how could you change the color of that blue to make it readable? There is a way by sending some escape command to the console:

echo -e "\\e]R\\e]PC6495ed"

That command changes the color of the blue to a light blue (somewhat "cyan", although not light cyan.)

The "\\e]R" part is to reset the colors to the default. You may or may not want to do that...

The "\\e]PC6495ed" changes the blue color, or color C (12). The P stands for Palette. And the "6495ed" is the hexadecimal color. (the color as in HTML.) To change other colors, use the same sequence with a different color number and color code. For example, the background color can be set to white with: "\\e]P0ffffff" (watch out! now what you write will be gray on white if not white on white...)

Anyway, there is the result of that echo command:

This is the fixed blue color.

Although it is still a bit difficult to read, I can see the letters this time!

Source: (search for Palette)