LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-11-2008, 04:11 PM   #1
mudflap
Member
 
Registered: Jul 2008
Location: Coffin Point
Distribution: Slackware - ttylinux - CPO
Posts: 53

Rep: Reputation: 15
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?

Last edited by mudflap; 10-12-2008 at 07:21 AM.
 
Old 10-12-2008, 11:09 AM   #2
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
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
 
Old 10-12-2008, 07:07 PM   #3
mudflap
Member
 
Registered: Jul 2008
Location: Coffin Point
Distribution: Slackware - ttylinux - CPO
Posts: 53

Original Poster
Rep: Reputation: 15
>> 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.
 
Old 10-12-2008, 07:27 PM   #4
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,614

Rep: Reputation: 136Reputation: 136
Maybe use white bold (1m) as color for directories ?
 
Old 10-12-2008, 10:54 PM   #5
mudflap
Member
 
Registered: Jul 2008
Location: Coffin Point
Distribution: Slackware - ttylinux - CPO
Posts: 53

Original Poster
Rep: Reputation: 15
>> 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.
 
Old 10-13-2008, 05:34 PM   #6
jimX86
Member
 
Registered: Mar 2006
Distribution: Slackware64 14.1
Posts: 231
Blog Entries: 1

Rep: Reputation: 34
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.)
 
Old 10-13-2008, 08:48 PM   #7
mudflap
Member
 
Registered: Jul 2008
Location: Coffin Point
Distribution: Slackware - ttylinux - CPO
Posts: 53

Original Poster
Rep: Reputation: 15
>> 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: CLI Magic: Use ANSI escape sequences to display a clock in your terminal LXer Syndicated Linux News 0 01-22-2008 10:20 PM
change eth0 and eth1 time out values...??? stevesutt89 Linux - Laptop and Netbook 1 11-01-2007 07:21 AM
How can I change BIOS values from console ? +Yan Linux - Software 1 08-28-2006 02:00 PM
Really strange change of string values in C realos Programming 34 08-08-2005 09:32 PM
Change prompt values from within a C++ program pshea Linux - Newbie 0 09-16-2003 11:06 PM


All times are GMT -5. The time now is 10:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration