Skip to content

Commit 7d91939

Browse files
committed
drop terminal palette index value
After last commit there are no holes in the palette any more, and each color is declared at the array index corresponding to its palette index. That makes this element superfluous.
1 parent 89a799c commit 7d91939

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

autoload/css_color.vim

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,36 @@ if has('gui_running')
5555
else
5656
" preset 16 vt100 colors
5757
let s:xtermcolor = [
58-
\ [ 0x00, 0x00, 0x00, 0 ],
59-
\ [ 0xCD, 0x00, 0x00, 1 ],
60-
\ [ 0x00, 0xCD, 0x00, 2 ],
61-
\ [ 0xCD, 0xCD, 0x00, 3 ],
62-
\ [ 0x00, 0x00, 0xEE, 4 ],
63-
\ [ 0xCD, 0x00, 0xCD, 5 ],
64-
\ [ 0x00, 0xCD, 0xCD, 6 ],
65-
\ [ 0xE5, 0xE5, 0xE5, 7 ],
66-
\ [ 0x7F, 0x7F, 0x7F, 8 ],
67-
\ [ 0xFF, 0x00, 0x00, 9 ],
68-
\ [ 0x00, 0xFF, 0x00, 10 ],
69-
\ [ 0xFF, 0xFF, 0x00, 11 ],
70-
\ [ 0x5C, 0x5C, 0xFF, 12 ],
71-
\ [ 0xFF, 0x00, 0xFF, 13 ],
72-
\ [ 0x00, 0xFF, 0xFF, 14 ],
73-
\ [ 0xFF, 0xFF, 0xFF, 15 ]]
58+
\ [ 0x00, 0x00, 0x00 ],
59+
\ [ 0xCD, 0x00, 0x00 ],
60+
\ [ 0x00, 0xCD, 0x00 ],
61+
\ [ 0xCD, 0xCD, 0x00 ],
62+
\ [ 0x00, 0x00, 0xEE ],
63+
\ [ 0xCD, 0x00, 0xCD ],
64+
\ [ 0x00, 0xCD, 0xCD ],
65+
\ [ 0xE5, 0xE5, 0xE5 ],
66+
\ [ 0x7F, 0x7F, 0x7F ],
67+
\ [ 0xFF, 0x00, 0x00 ],
68+
\ [ 0x00, 0xFF, 0x00 ],
69+
\ [ 0xFF, 0xFF, 0x00 ],
70+
\ [ 0x5C, 0x5C, 0xFF ],
71+
\ [ 0xFF, 0x00, 0xFF ],
72+
\ [ 0x00, 0xFF, 0xFF ],
73+
\ [ 0xFF, 0xFF, 0xFF ]]
7474

7575
" the 6 values used in the xterm color cube
7676
" 0 95 135 175 215 255
7777
let s:cubergb = [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ]
7878
for s:rrr in s:cubergb
7979
for s:ggg in s:cubergb
8080
for s:bbb in s:cubergb
81-
call add( s:xtermcolor, [ s:rrr, s:ggg, s:bbb, len(s:xtermcolor) ] )
81+
call add( s:xtermcolor, [ s:rrr, s:ggg, s:bbb ] )
8282
endfor
8383
endfor
8484
endfor
8585

8686
" grayscale ramp
87-
let s:xtermcolor += map(range(24),'repeat([10*v:val+8],3) + [v:val+232]')
87+
let s:xtermcolor += map( range(24), 'repeat( [10 * v:val + 8], 3 )' )
8888

8989
" selects the nearest xterm color for a rgb value like #FF0000
9090
function! s:rgb2xterm(color)
@@ -95,7 +95,8 @@ else
9595
let g = s:hex[color[2:3]]
9696
let b = s:hex[color[4:5]]
9797

98-
for [tr,tg,tb,idx] in s:xtermcolor
98+
for idx in range(len(s:xtermcolor))
99+
let [tr,tg,tb] = s:xtermcolor[idx]
99100
let dr = tr - r
100101
let dg = tg - g
101102
let db = tb - b

0 commit comments

Comments
 (0)