Skip to content

Commit c4e3925

Browse files
author
pi-rho
committed
Honor termguicolors and terminals with t_co > 256. Fixes: ap#186
1 parent faa6593 commit c4e3925

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

autoload/css_color.vim

+12-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33
" Commit: $Format:%H$
44
" Licence: The MIT License (MIT)
55

6-
if ! ( v:version >= 700 && has('syntax') && ( has('gui_running') || has('nvim') || &t_Co == 256 ) )
6+
if ! ( v:version >= 700 && has('syntax') && (
7+
\ has('gui_running') ||
8+
\ has('nvim') ||
9+
\ (has('termguicolors') && &termguicolors) ||
10+
\ &t_Co >= 256
11+
\ ) )
712
function! css_color#init(type, keywords, groups)
813
endfunction
914
function! css_color#extend(groups)
1015
endfunction
16+
function! css_color#disabled()
17+
return v:true
18+
endfunction
1119
finish
1220
endif
1321

22+
function! css_color#disabled()
23+
return v:false
24+
endfunction
1425
function! s:rgb2color(r,g,b)
1526
" Convert 80% -> 204, 100% -> 255, etc.
1627
let rgb = map( [a:r,a:g,a:b], 'v:val =~ "%$" ? ( 255 * v:val ) / 100 : v:val' )

0 commit comments

Comments
 (0)