gruvbox-community / gruvbox

Retro groove color scheme for Vim - community maintained edition
MIT License
801 stars 62 forks source link

How can I make the GUI version look like the terminal version+notermguicolors? #116

Closed STaRDoGGCHaMP closed 5 years ago

STaRDoGGCHaMP commented 5 years ago

Consider the following comparison:

Left: vim 8.1 on Arch Linux (over ssh with PuTTY+xterm-256color) Right: gvim 8.1 on Windows 10

I personally like the left side more because of the less bright colors and I would like to have the exact same colors while using gvim. These less bright colors are the result of notermguicolors, which is demonstrated by the following comparison:

However, setting notermguicolors does of course not have any effect on gvim. Is there still a way to achieve the exact color scheme on the left in gvim?

rbong commented 5 years ago

If you would like the exact same colors, you will have to set the g:gruvbox_colors option with the appropriate colors. Here is a wiki link on the option.

The most direct way to do what you want is to override these colors (see the palette).

You can find the terminal colors you're looking for in the dark palette image. 256 color variants are listed in the top left corner.

However if you're looking for less bright colors, a more supported way to do this would be to set g:gruvbox_contrast_dark and set dark0 in g:gruvbox_colors to a darker value.

Let me know if that answers your question.

STaRDoGGCHaMP commented 5 years ago

Thanks a bunch. The following does the trick. RGB values are taken from the xterm 256 Color Chart [1].

" color scheme
set background=dark
if has("termguicolors")
    set notermguicolors
endif
let g:gruvbox_colors = {
    \ "dark0_hard":       ["#1c1c1c", 234],
    \ "dark0":            ["#262626", 235],
    \ "dark0_soft":       ["#303030", 236],
    \ "dark1":            ["#3a3a3a", 237],
    \ "dark2":            ["#4e4e4e", 239],
    \ "dark3":            ["#626262", 241],
    \ "dark4":            ["#767676", 243],
    \ "dark4_256":        ["#767676", 243],
    \ "gray_245":         ["#8a8a8a", 245],
    \ "gray_244":         ["#808080", 244],
    \ "light0_hard":      ["#ffffd7", 230],
    \ "light0":           ["#ffffaf", 229],
    \ "light0_soft":      ["#ffff87", 228],
    \ "light1":           ["#ffd7af", 223],
    \ "light2":           ["#bcbcbc", 250],
    \ "light3":           ["#a8a8a8", 248],
    \ "light4":           ["#949494", 246],
    \ "light4_256":       ["#949494", 246],
    \ "bright_red":       ['#d75f5f', 167],
    \ "bright_green":     ["#afaf00", 142],
    \ "bright_yellow":    ["#ffaf00", 214],
    \ "bright_blue":      ["#87afaf", 109],
    \ "bright_purple":    ["#d787af", 175],
    \ "bright_aqua":      ["#87af87", 108],
    \ "bright_orange":    ["#ff8700", 208],
    \ "neutral_red":      ["#af0000", 124],
    \ "neutral_green":    ["#87af00", 106],
    \ "neutral_yellow":   ["#d78700", 172],
    \ "neutral_blue":     ["#5f8787", 66] ,
    \ "neutral_purple":   ["#af5f87", 132],
    \ "neutral_aqua":     ["#5faf87", 72] ,
    \ "neutral_orange":   ["#d75f00", 166],
    \ "faded_red":        ["#870000", 88] ,
    \ "faded_green":      ["#878700", 100],
    \ "faded_yellow":     ["#af8700", 136],
    \ "faded_blue":       ["#005f87", 24] ,
    \ "faded_purple":     ["#875f87", 96] ,
    \ "faded_aqua":       ["#5f875f", 65] ,
    \ "faded_orange":     ["#af5f00", 130],
    \ "bg0":              ["#262626", 235],
    \ "bg1":              ["#3a3a3a", 237],
    \ "bg2":              ["#4e4e4e", 239],
    \ "bg3":              ["#626262", 241],
    \ "bg4":              ["#767676", 243],
    \ "gray":             ["#8a8a8a", 245],
    \ "fg0":              ["#ffffaf", 229],
    \ "fg1":              ["#ffd7af", 223],
    \ "fg2":              ["#bcbcbc", 250],
    \ "fg3":              ["#a8a8a8", 248],
    \ "fg4":              ["#949494", 246],
    \ "fg4_256":          ["#949494", 246],
    \ "red":              ["#d75f5f", 167],
    \ "green":            ["#afaf00", 142],
    \ "yellow":           ["#ffaf00", 214],
    \ "blue":             ["#87afaf", 109],
    \ "purple":           ["#d787af", 175],
    \ "aqua":             ["#87af87", 108],
    \ "orange":           ["#87af87", 108]
\}
colorscheme gruvbox

[1] https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg

rbong commented 5 years ago

Glad you were able to get this to work, feel free to reopen if you encounter any problems.