From: Stefan Wimmer Date: Fri, 1 May 2020 11:52:38 +0000 (+0200) Subject: Make 'Normal' foreground plain 'black' or 'white' if dimmed colours are enabled. X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/536551e394b2de152673f5f0d280105ee4cbcc5c?ds=sidebyside;hp=--cc Make 'Normal' foreground plain 'black' or 'white' if dimmed colours are enabled. --- 536551e394b2de152673f5f0d280105ee4cbcc5c diff --git a/colors/artesanal.vim b/colors/artesanal.vim index 905a385..b6e71f3 100644 --- a/colors/artesanal.vim +++ b/colors/artesanal.vim @@ -4,7 +4,7 @@ " Maintainer: Stefan Wimmer " Website: https://github.com/wimstefan/vim-artesanal " License: Vim License (see `:help license`) -" Last Updated: Wed 29 Apr 2020 12:54:19 AM CEST +" Last Updated: Fri 01 May 2020 01:51:52 PM CEST " Generated by Colortemplate v2.0.0 @@ -42,6 +42,19 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_color_15 = '#eff1f4' endif if !has('gui_running') && get(g:, 'artesanal_dimmed', 0) + if &background ==# 'light' + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal guifg=#000000 guibg=NONE guisp=NONE gui=NONE cterm=NONE + else + hi Normal guifg=#000000 guibg=#2e3440 guisp=NONE gui=NONE cterm=NONE + endif + elseif !has('gui_running') && &background ==# 'dark' + if get(g:, 'artesanal_transparent', 0) + hi Normal guifg=#ffffff guibg=NONE guisp=NONE gui=NONE cterm=NONE + else + hi Normal guifg=#ffffff guibg=#2e3440 guisp=NONE gui=NONE cterm=NONE + endif + endif hi Conceal guifg=#517aa3 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi Constant guifg=#008c65 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi Directory guifg=#517aa3 guibg=NONE guisp=NONE gui=bold cterm=bold @@ -57,6 +70,11 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') hi WarningMsg guifg=#dc1b33 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi WildMenu guifg=#517aa3 guibg=#455a64 guisp=NONE gui=bold cterm=bold else + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal guifg=#e4e6eb guibg=NONE guisp=NONE gui=NONE cterm=NONE + else + hi Normal guifg=#e4e6eb guibg=#2e3440 guisp=NONE gui=NONE cterm=NONE + endif hi Conceal guifg=#6699cc guibg=NONE guisp=NONE gui=NONE cterm=NONE hi Constant guifg=#00bf8a guibg=NONE guisp=NONE gui=NONE cterm=NONE hi Directory guifg=#6699cc guibg=NONE guisp=NONE gui=bold cterm=bold @@ -73,13 +91,11 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') hi WildMenu guifg=#6699cc guibg=#455a64 guisp=NONE gui=bold cterm=bold endif if !has('gui_running') && get(g:, 'artesanal_transparent', 0) - hi Normal guifg=#e4e6eb guibg=NONE guisp=NONE gui=NONE cterm=NONE hi CursorLineNr guifg=#fff176 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi FoldColumn guifg=#575c66 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi SignColumn guifg=#cdd2db guibg=NONE guisp=NONE gui=NONE cterm=NONE hi VertSplit guifg=#546e7a guibg=NONE guisp=NONE gui=NONE cterm=NONE else - hi Normal guifg=#e4e6eb guibg=#2e3440 guisp=NONE gui=NONE cterm=NONE hi CursorLineNr guifg=#fff176 guibg=#37474f guisp=NONE gui=NONE cterm=NONE hi FoldColumn guifg=#575c66 guibg=#37474f guisp=NONE gui=NONE cterm=NONE hi SignColumn guifg=#cdd2db guibg=#37474f guisp=NONE gui=NONE cterm=NONE @@ -202,6 +218,19 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_color_15 = '#ffffff' endif if !has('gui_running') && get(g:, 'artesanal_dimmed', 0) + if &background ==# 'light' + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal guifg=#000000 guibg=NONE guisp=NONE gui=NONE cterm=NONE + else + hi Normal guifg=#000000 guibg=#eff1f4 guisp=NONE gui=NONE cterm=NONE + endif + elseif !has('gui_running') && &background ==# 'dark' + if get(g:, 'artesanal_transparent', 0) + hi Normal guifg=#ffffff guibg=NONE guisp=NONE gui=NONE cterm=NONE + else + hi Normal guifg=#ffffff guibg=#eff1f4 guisp=NONE gui=NONE cterm=NONE + endif + endif hi Conceal guifg=#00409b guibg=NONE guisp=NONE gui=NONE cterm=NONE hi Constant guifg=#00814b guibg=NONE guisp=NONE gui=NONE cterm=NONE hi Directory guifg=#00409b guibg=NONE guisp=NONE gui=bold cterm=bold @@ -217,6 +246,11 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') hi WarningMsg guifg=#971223 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi WildMenu guifg=#00409b guibg=#cdd2db guisp=NONE gui=bold cterm=bold else + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal guifg=#37474f guibg=NONE guisp=NONE gui=NONE cterm=NONE + else + hi Normal guifg=#37474f guibg=#eff1f4 guisp=NONE gui=NONE cterm=NONE + endif hi Conceal guifg=#004bb4 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi Constant guifg=#009a5a guibg=NONE guisp=NONE gui=NONE cterm=NONE hi Directory guifg=#004bb4 guibg=NONE guisp=NONE gui=bold cterm=bold @@ -233,13 +267,11 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') hi WildMenu guifg=#004bb4 guibg=#cdd2db guisp=NONE gui=bold cterm=bold endif if !has('gui_running') && get(g:, 'artesanal_transparent', 0) - hi Normal guifg=#37474f guibg=NONE guisp=NONE gui=NONE cterm=NONE hi CursorLineNr guifg=#ff8c00 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi FoldColumn guifg=#575c66 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi SignColumn guifg=#455a64 guibg=NONE guisp=NONE gui=NONE cterm=NONE hi VertSplit guifg=#b6bdcb guibg=NONE guisp=NONE gui=NONE cterm=NONE else - hi Normal guifg=#37474f guibg=#eff1f4 guisp=NONE gui=NONE cterm=NONE hi CursorLineNr guifg=#ff8c00 guibg=#e4e6eb guisp=NONE gui=NONE cterm=NONE hi FoldColumn guifg=#575c66 guibg=#e4e6eb guisp=NONE gui=NONE cterm=NONE hi SignColumn guifg=#455a64 guibg=#e4e6eb guisp=NONE gui=NONE cterm=NONE @@ -343,6 +375,25 @@ endif if s:t_Co >= 256 if &background ==# 'dark' if !has('gui_running') && get(g:, 'artesanal_dimmed', 0) + if &background ==# 'light' + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=16 ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=16 ctermbg=236 cterm=NONE + if !has('patch-8.0.0616') && !has('nvim') " Fix for Vim bug + set background=dark + endif + endif + elseif !has('gui_running') && &background ==# 'dark' + if get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=231 ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=231 ctermbg=236 cterm=NONE + if !has('patch-8.0.0616') && !has('nvim') " Fix for Vim bug + set background=dark + endif + endif + endif hi Conceal ctermfg=67 ctermbg=NONE cterm=NONE hi Constant ctermfg=29 ctermbg=NONE cterm=NONE hi Directory ctermfg=67 ctermbg=NONE cterm=bold @@ -358,6 +409,14 @@ if s:t_Co >= 256 hi WarningMsg ctermfg=160 ctermbg=NONE cterm=NONE hi WildMenu ctermfg=67 ctermbg=240 cterm=bold else + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=254 ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=254 ctermbg=236 cterm=NONE + if !has('patch-8.0.0616') && !has('nvim') " Fix for Vim bug + set background=dark + endif + endif hi Conceal ctermfg=67 ctermbg=NONE cterm=NONE hi Constant ctermfg=36 ctermbg=NONE cterm=NONE hi Directory ctermfg=67 ctermbg=NONE cterm=bold @@ -374,16 +433,11 @@ if s:t_Co >= 256 hi WildMenu ctermfg=67 ctermbg=240 cterm=bold endif if !has('gui_running') && get(g:, 'artesanal_transparent', 0) - hi Normal ctermfg=254 ctermbg=NONE cterm=NONE hi CursorLineNr ctermfg=228 ctermbg=NONE cterm=NONE hi FoldColumn ctermfg=59 ctermbg=NONE cterm=NONE hi SignColumn ctermfg=252 ctermbg=NONE cterm=NONE hi VertSplit ctermfg=242 ctermbg=NONE cterm=NONE else - hi Normal ctermfg=254 ctermbg=236 cterm=NONE - if !has('patch-8.0.0616') && !has('nvim') " Fix for Vim bug - set background=dark - endif hi CursorLineNr ctermfg=228 ctermbg=238 cterm=NONE hi FoldColumn ctermfg=59 ctermbg=238 cterm=NONE hi SignColumn ctermfg=252 ctermbg=238 cterm=NONE @@ -480,6 +534,19 @@ if s:t_Co >= 256 endif " Light background if !has('gui_running') && get(g:, 'artesanal_dimmed', 0) + if &background ==# 'light' + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=16 ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=16 ctermbg=255 cterm=NONE + endif + elseif !has('gui_running') && &background ==# 'dark' + if get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=231 ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=231 ctermbg=255 cterm=NONE + endif + endif hi Conceal ctermfg=25 ctermbg=NONE cterm=NONE hi Constant ctermfg=29 ctermbg=NONE cterm=NONE hi Directory ctermfg=25 ctermbg=NONE cterm=bold @@ -495,6 +562,11 @@ if s:t_Co >= 256 hi WarningMsg ctermfg=88 ctermbg=NONE cterm=NONE hi WildMenu ctermfg=25 ctermbg=252 cterm=bold else + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=238 ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=238 ctermbg=255 cterm=NONE + endif hi Conceal ctermfg=26 ctermbg=NONE cterm=NONE hi Constant ctermfg=35 ctermbg=NONE cterm=NONE hi Directory ctermfg=26 ctermbg=NONE cterm=bold @@ -511,13 +583,11 @@ if s:t_Co >= 256 hi WildMenu ctermfg=26 ctermbg=252 cterm=bold endif if !has('gui_running') && get(g:, 'artesanal_transparent', 0) - hi Normal ctermfg=238 ctermbg=NONE cterm=NONE hi CursorLineNr ctermfg=208 ctermbg=NONE cterm=NONE hi FoldColumn ctermfg=59 ctermbg=NONE cterm=NONE hi SignColumn ctermfg=240 ctermbg=NONE cterm=NONE hi VertSplit ctermfg=250 ctermbg=NONE cterm=NONE else - hi Normal ctermfg=238 ctermbg=255 cterm=NONE hi CursorLineNr ctermfg=208 ctermbg=254 cterm=NONE hi FoldColumn ctermfg=59 ctermbg=254 cterm=NONE hi SignColumn ctermfg=240 ctermbg=254 cterm=NONE @@ -616,6 +686,19 @@ endif if s:t_Co >= 16 if &background ==# 'dark' if !has('gui_running') && get(g:, 'artesanal_dimmed', 0) + if &background ==# 'light' + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=Black ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=Black ctermbg=Black cterm=NONE + endif + elseif !has('gui_running') && &background ==# 'dark' + if get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=White ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=White ctermbg=Black cterm=NONE + endif + endif hi Conceal ctermfg=DarkBlue ctermbg=NONE cterm=NONE hi Constant ctermfg=DarkGreen ctermbg=NONE cterm=NONE hi Directory ctermfg=DarkBlue ctermbg=NONE cterm=bold @@ -631,6 +714,11 @@ if s:t_Co >= 16 hi WarningMsg ctermfg=DarkRed ctermbg=NONE cterm=NONE hi WildMenu ctermfg=DarkBlue ctermbg=DarkGrey cterm=bold else + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=White ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=White ctermbg=Black cterm=NONE + endif hi Conceal ctermfg=Blue ctermbg=NONE cterm=NONE hi Constant ctermfg=Green ctermbg=NONE cterm=NONE hi Directory ctermfg=Blue ctermbg=NONE cterm=bold @@ -647,13 +735,11 @@ if s:t_Co >= 16 hi WildMenu ctermfg=Blue ctermbg=DarkGrey cterm=bold endif if !has('gui_running') && get(g:, 'artesanal_transparent', 0) - hi Normal ctermfg=White ctermbg=NONE cterm=NONE hi CursorLineNr ctermfg=Yellow ctermbg=NONE cterm=NONE hi FoldColumn ctermfg=DarkGray ctermbg=NONE cterm=NONE hi SignColumn ctermfg=LightGrey ctermbg=NONE cterm=NONE hi VertSplit ctermfg=DarkGrey ctermbg=NONE cterm=NONE else - hi Normal ctermfg=White ctermbg=Black cterm=NONE hi CursorLineNr ctermfg=Yellow ctermbg=Black cterm=NONE hi FoldColumn ctermfg=DarkGray ctermbg=Black cterm=NONE hi SignColumn ctermfg=LightGrey ctermbg=Black cterm=NONE @@ -750,6 +836,19 @@ if s:t_Co >= 16 endif " Light background if !has('gui_running') && get(g:, 'artesanal_dimmed', 0) + if &background ==# 'light' + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=Black ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=Black ctermbg=White cterm=NONE + endif + elseif !has('gui_running') && &background ==# 'dark' + if get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=White ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=White ctermbg=White cterm=NONE + endif + endif hi Conceal ctermfg=DarkBlue ctermbg=NONE cterm=NONE hi Constant ctermfg=DarkGreen ctermbg=NONE cterm=NONE hi Directory ctermfg=DarkBlue ctermbg=NONE cterm=bold @@ -765,6 +864,11 @@ if s:t_Co >= 16 hi WarningMsg ctermfg=DarkRed ctermbg=NONE cterm=NONE hi WildMenu ctermfg=DarkBlue ctermbg=LightGrey cterm=bold else + if !has('gui_running') && get(g:, 'artesanal_transparent', 0) + hi Normal ctermfg=Black ctermbg=NONE cterm=NONE + else + hi Normal ctermfg=Black ctermbg=White cterm=NONE + endif hi Conceal ctermfg=Blue ctermbg=NONE cterm=NONE hi Constant ctermfg=Green ctermbg=NONE cterm=NONE hi Directory ctermfg=Blue ctermbg=NONE cterm=bold @@ -781,13 +885,11 @@ if s:t_Co >= 16 hi WildMenu ctermfg=Blue ctermbg=LightGrey cterm=bold endif if !has('gui_running') && get(g:, 'artesanal_transparent', 0) - hi Normal ctermfg=Black ctermbg=NONE cterm=NONE hi CursorLineNr ctermfg=Yellow ctermbg=NONE cterm=NONE hi FoldColumn ctermfg=DarkGray ctermbg=NONE cterm=NONE hi SignColumn ctermfg=DarkGrey ctermbg=NONE cterm=NONE hi VertSplit ctermfg=DarkGrey ctermbg=NONE cterm=NONE else - hi Normal ctermfg=Black ctermbg=White cterm=NONE hi CursorLineNr ctermfg=Yellow ctermbg=White cterm=NONE hi FoldColumn ctermfg=DarkGray ctermbg=White cterm=NONE hi SignColumn ctermfg=DarkGrey ctermbg=White cterm=NONE @@ -895,6 +997,7 @@ endif " Color: bg3 #b6bdcb ~ DarkGrey " Color: bg4 #9fa8ba ~ DarkGrey " Color: black #121419 ~ Black +" Color: realblack #000000 ~ Black " Color: darkgray #575c66 ~ DarkGray " Color: red #ae1528 ~ Red " Color: brightred #ddabbc ~ LightRed @@ -930,6 +1033,7 @@ endif " Color: bg3 #546e7a ~ DarkGrey " Color: bg4 #90a4ae ~ LightGrey " Color: black #121419 ~ Black +" Color: realblack #000000 ~ Black " Color: darkgray #575c66 ~ DarkGray " Color: red #e84256 ~ Red " Color: brightred #ddabbc ~ LightRed diff --git a/doc/artesanal.txt b/doc/artesanal.txt index 1255005..0fc7455 100644 --- a/doc/artesanal.txt +++ b/doc/artesanal.txt @@ -1,4 +1,4 @@ -*artesanal.txt* For Vim version 8.2 Last change: 2020 Apr 29 +*artesanal.txt* For Vim version 8.2 Last change: 2020 May 01 Artesanal color scheme by Stefan Wimmer diff --git a/templates/_common.colortemplate b/templates/_common.colortemplate index 0cc207c..10fdf3c 100644 --- a/templates/_common.colortemplate +++ b/templates/_common.colortemplate @@ -3,6 +3,19 @@ # Default highlight groups {{{ #if !has('gui_running') && get(g:, '@optionprefix_dimmed', 0) # dimmed colours + #if &background ==# 'light' + #if !has('gui_running') && get(g:, '@optionprefix_transparent', 0) + Normal realblack none + #else + Normal realblack bg0 + #endif + #elseif !has('gui_running') && &background ==# 'dark' + #if get(g:, '@optionprefix_transparent', 0) + Normal brightwhite none + #else + Normal brightwhite bg0 + #endif + #endif Conceal darkblue none Constant darkgreen none Directory darkblue none bold @@ -19,6 +32,11 @@ WildMenu darkblue bg2 bold #else # default colours + #if !has('gui_running') && get(g:, '@optionprefix_transparent', 0) + Normal fg1 none + #else + Normal fg1 bg0 + #endif Conceal blue none Constant green none Directory blue none bold @@ -36,14 +54,12 @@ #endif #if !has('gui_running') && get(g:, '@optionprefix_transparent', 0) # transparent background - Normal fg1 none CursorLineNr yellow none FoldColumn darkgray none SignColumn fg2 none VertSplit bg3 none #else # opaque background - Normal fg1 bg0 CursorLineNr yellow bg1 FoldColumn darkgray bg1 SignColumn fg2 bg1 diff --git a/templates/_dark.colortemplate b/templates/_dark.colortemplate index 8fa3288..cf8ed91 100644 --- a/templates/_dark.colortemplate +++ b/templates/_dark.colortemplate @@ -3,6 +3,7 @@ # Comment out (do not delete) the definitions that you want to keep at their default. # Color name GUI Base256 Base16 (optional) Color: black #121419 ~ Black +Color: realblack #000000 ~ Black Color: darkgray #575c66 ~ DarkGray Color: red #e84256 ~ Red Color: brightred #ddabbc ~ LightRed diff --git a/templates/_light.colortemplate b/templates/_light.colortemplate index 4abd231..c2b1567 100644 --- a/templates/_light.colortemplate +++ b/templates/_light.colortemplate @@ -3,6 +3,7 @@ # Comment out (do not delete) the definitions that you want to keep at their default. # Color name GUI Base256 Base16 (optional) Color: black #121419 ~ Black +Color: realblack #000000 ~ Black Color: darkgray #575c66 ~ DarkGray Color: red #ae1528 ~ Red Color: brightred #ddabbc ~ LightRed