[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 256 Terminal Color Question ...
From: |
Mike Gran |
Subject: |
Re: 256 Terminal Color Question ... |
Date: |
Thu, 1 Oct 2009 09:08:32 -0700 (PDT) |
> From: Ben Duncan <address@hidden>
> init_color defines the palette RGB as a value between 0 and 1000.
>
> I am looking at 256 Web Safe Colors chart and find out the RGB values.
> The RGB values are listed in HEX as well as Decimal.
>
> (see: http://en.wikipedia.org/wiki/Web_colors )
>
> My question is how do I convert those RGB values to the the
> correct NUMERIC value value required by init_color to come out
> the the color chart as listed?
I know that for xterm on my box, the default colors don't use the
whole 0 to 1000 range. White is set at R=680, G=680 B=680 or some-
thing like that. I always assumed that they reserve the difference
between 680 and 1000 for 'bold', but, that's just a guess. I know
for some non-xterm terminals, white is R=1000, G=1000, B=1000.
I think you could get a decent match by just multiplying
the decimal (0-255) values in the wikipedia table by 3. That'd
put you from 0 to 785. That way, you split the difference
between white=680/680/680 and white=1000/1000/1000 terminals.
The true answer to your question on how you match those colors
in the table exactly is going to be different for each terminal
or terminal emulator, I think.
-Mike