background color gray instead of black

1,081 views
Skip to first unread message

Britton Kerin

unread,
Jul 28, 2012, 3:11:23 PM7/28/12
to vim...@googlegroups.com
I've tried both these commands:

:highlight Normal ctermbg=black
:highlight Normal ctermbg=0

but the background is still ugly grey not true black.

Hmm after a bit more experimentation I find this does what I want:

:highlight Normal ctermbg=255
:highlight Normal ctermbg=255

I guess this has to do with the colorscheme torte that I use in .vimrc,
it just seems a bit weird the explicitly setting the color twice to what
one would expect to be white is required to get it to be black :)

Florian Rehnisch

unread,
Jul 28, 2012, 8:23:54 PM7/28/12
to vim...@googlegroups.com
Maybe your terminal emulator? (gnome-terminal or konsole)

I use urxvt, switched to :colo torte and :syn on, and have
a brilliant black bg ...

Chris Jones

unread,
Jul 28, 2012, 8:56:56 PM7/28/12
to vim...@googlegroups.com
What does ‘:verbose hi Normal' display..?

What color is the top left rectangle when you run 256colors2.pl from a
shell prompt..?

CJ

--
SOMEBODY SET UP US THE BOMB

Britton Kerin

unread,
Jul 29, 2012, 1:03:43 PM7/29/12
to vim...@googlegroups.com
On Sat, Jul 28, 2012 at 4:56 PM, Chris Jones <cjns...@gmail.com> wrote:
> On Sat, Jul 28, 2012 at 03:11:23PM EDT, Britton Kerin wrote:
>> I've tried both these commands:
>>
>> :highlight Normal ctermbg=black
>> :highlight Normal ctermbg=0
>>
>> but the background is still ugly grey not true black.
>>
>> Hmm after a bit more experimentation I find this does what I want:
>>
>> :highlight Normal ctermbg=255
>> :highlight Normal ctermbg=255
>>
>> I guess this has to do with the colorscheme torte that I use in .vimrc,
>> it just seems a bit weird the explicitly setting the color twice to what
>> one would expect to be white is required to get it to be black :)
>>
> What does ‘:verbose hi Normal' display..?

I am using gnome-terminal with a white on black color scheme.

Initially it looks like this:

:verbose hi Normal
Normal xxx ctermfg=7 ctermbg=0 guifg=Grey80 guibg=Black
Last set from ~/local/share/vim/vim73/colors/torte.vim
Press ENTER or type command to continue

It looks the same after the first ctermbg=255 command above. t After the second
one, the output changes showing ctermbg=255 instead of ctermbg=0.

> What color is the top left rectangle when you run 256colors2.pl from a
> shell prompt..?

I wasn't sure where this script came from and I found a couple of
different versions. One of them first outputs a block called System
colors, and the top left of that is gray. Its had to tell but it
appears to be a bit darker than the gray I get in vim though.

Britton

>
> CJ
>
> --
> SOMEBODY SET UP US THE BOMB
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Chris Jones

unread,
Jul 29, 2012, 3:05:15 PM7/29/12
to vim...@googlegroups.com
On Sun, Jul 29, 2012 at 01:03:43PM EDT, Britton Kerin wrote:
> On Sat, Jul 28, 2012 at 4:56 PM, Chris Jones <cjns...@gmail.com> wrote:

[..]
>
> It looks the same after the first ctermbg=255 command above. t After
> the second one, the output changes showing ctermbg=255 instead of
> ctermbg=0.

> > What color is the top left rectangle when you run 256colors2.pl from
> > a shell prompt..?

> I wasn't sure where this script came from and I found a couple of
> different versions. One of them first outputs a block called System
> colors, and the top left of that is gray. Its had to tell but it
> appears to be a bit darker than the gray I get in vim though.

Makes sense.. That particular rectangle corresponds to color 0 and
I believe it should be black.

But what doesn't make sense is that color 255 should correspond to
white or a very light grey..!

Color 255 is be the last rectangle in what is referred to as the
‘Grayscale Ramp’ in 256color2.pl's output.

But then, this may be irrelevant, since ‘torte’ is an 8/16 color scheme
anyway. Specifying color values to override torte's by anything above 15
would likely give ‘unpredictable results’.

Suggestions:

What is the output of the following:

| :verbose set background
| :verbose set t_Co
| :display $TERM

Where the ‘background’ Vim option is concerned, it may be of interest to
see its value at startup and also after you change the default value of
the background, if done manually. See if Vim has automatically adjusted
it.

| :h 'background'

As to the value of the $TERM environment variable, where is it set -- or
do you just use gnome-terminal's default?

IIRC, gnome-terminal forcibly resets the value of $TERM to ‘xterm’ no
matter what you try to set it to prior to launching gnome-terminal.

Since I have no idea what is going on, you could try to to play with the
color palette in the gnome-terminal Preferences (?) dialog and see what
happens re: 256colors2.pl and in Vim with :colo torte... Might help
narrow it down..

CJ

--
Oh My God!!! Larry is back!
Reply all
Reply to author
Forward
0 new messages