Search code examples
vimcolor-scheme

Is that bug or feature..?


...if vim won't allow:

highlight normal ctermbg=#e0e0e0

but will have no problem at all when doing (e.g.):

URxvt.color10: #e0e0e0       <- Xresources
highlight normal ctermbg=10

?

Bonus question is: Can I add color-scheme tag to this vim related question, when its description is

A color scheme is a set of colors used by an IDE

?


Solution

  • urxvt supports 256 colors. If you gave a #rrggbb color in .Xresource (or deprecated .Xdefault), urvt will pick the nearest color in the palette to this r/g/b tuple.

    Terminal Vim can support up to 256 color too. But doesn't support the #rrggbb color format, instead, it supports a {color-nr} (:h color-nr for detail). It is [0,t_Co). That is t_Co was set to 256, then the available color-nr is [0,256).

    Therefore urxvt and vim are different applications, they support different color formats. You cannot say it is a bug of vim because it doesn't support some format from other application.

    And personally I think it is not a feature either, it is just a setting/option/config.