LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Can I change the ANSI RGB values for CLI (https://www.linuxquestions.org/questions/slackware-14/can-i-change-the-ansi-rgb-values-for-cli-675734/)

mudflap 10-11-2008 04:11 PM

Can I change the ANSI RGB values for CLI
 
I want to change the ANSI colour pallette on the console (CLI not GUI).

I find certain colours are difficult to see against the black background, in my case blue. I know someone who cannot see dark red against black while red stands out nicely for me.

Modifying the DIRCOLORS entries is not a solution because the pallette is still limited to the same 16 colours and blue remains the same blue wherever I use it.

Attempts to use a 256 colour pallette can produce unexpected results elsewhere and can introduce dependencies I am not willing to propagate through the system.

As I understand it, RGB values for the ANSI pallette are assigned by the video display manufacturer, and I have seen these variations myself. (Matrox green may not be the same as ATI green for example)

Is there some fairly simple:) means by which I can access and modify the low level RGB values for the basic pallette?

kodon 10-12-2008 11:09 AM

never considered it...

but if you can change them
would it still be considered a standard?

the simplest thing to do would be to
change the color saturation/contrast/brightness
levels on the monitor

as well as changing the foreground
and/or background colors of the console

mudflap 10-12-2008 07:07 PM

>> kodon


-> but if you can change them would it still be considered a standard?

I was not refering to any ANSI colour standard, but rather to the ANSI escape sequences which provide eight basic colours, modified by perhaps as many as eight attributes. On a VGA display this results in 16 colours. On a Herculese display: bold, blinking, reversed, underlined, and perhaps strikethrough text might be available.

In this case the "standard" as I understand it only requires that an instruction to the video display which calls for one of these eight colours, yellow (for example), returns something the video display _manufacturer_ has defined as yellow.

PS1='\033[01:33m\w.\h \w/ \033[0m' should change the prompt to (bright) yellow.

PS1='\033[00:31m\w.\h \w/ \033[0m' should change the prompt to (dark) red

I percieve "01:31" as bleeding orange on some systems, bright red on others, and sometimes something decidedly pinkish.


-> the simplest thing to do would be to change the color saturation/contrast/brightness levels on the monitor

Not an option, distorting the colour balance for the console will make any AV signal unpleasant to watch, and the monitor would certainly require adjusting every time I switched in or out of GUI world. I also run four systems with wildly different display capabilities through one KVM. That is an awful lot of fiddling and fussing about.


-> as well as changing the foreground and/or background colors of the console

If not through DIRCOLORS and escape sequences, I am begging for suggestions.

keefaz 10-12-2008 07:27 PM

Maybe use white bold (1m) as color for directories ?

mudflap 10-12-2008 10:54 PM

>> keefaz

That has been my solution to date. My current choice is bold white, very legible but can be washed out by ambient light. Bright yellow is fine only so long as I never enter the /dev directory.

jimX86 10-13-2008 05:34 PM

If you're using a framebuffer, I think you should be able to do this. Check out the man page for console_codes. (The part about changing the color palette.)

The first 8 linux console colors go like this: 0=black (background), 1=red, 2=green, 3=brown, 4=blue, 5=magenta, 6=cyan, 7=white (foreground). On my console, the next 8 colors appear to be "brighter" colors; 8=grey, 9=red, A=green, B=yellow, C=blue, D=magenta, E=cyan, and F=white. To change the color for "bright blue" directories to a different blue, you could add this line to /etc/rc.d/rc.local:

Code:

echo -en "\e]PC0BB5FF"
The part you'll change is the last 7 characters after the "P". (nrrggbb, where n=the color number from 0-15 (in hex) and rrggbb=the hex color code.)

mudflap 10-13-2008 08:48 PM

>> jimX86

Thank you. For the next few days, at least one console is going to look like a used car lot while I play with this.


All times are GMT -5. The time now is 01:28 AM.