Tuesday, October 5, 2010

Re: Getting background color of Normal highlight group.

Hi,

Maxim Kim wrote:
>
> Could anyone point me if there is a way I can find out background
> color of Normal highlight group?
>
> I need it in form of #RRGGBB.
>
> What I have at the moment:
>
>
> redir => hlstatus
> silent hi Normal
> redir END
> echo matchstr(hlstatus, 'guibg\s*=\s*\zs\S\+')
>
>
> It
> * prints empty string on 'default' colorscheme -- that is fine;
> * prints #000040 on 'darkblue' colorscheme -- fine too;
> * prints 'darkBlue' on 'blue' colorscheme -- that's not what I
> want.
>
> Is it possible to convert 'darkBlue' type of colors to #RRGGBB format?
>
> Or is there an easier way to find background color?

Vim comes with a file rgb.txt which contains a list of RGB values and
color names. (See :help rgb.txt) You can load this file and search for
the color name you extracted from the output of your command.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

--
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

No comments:

Post a Comment