@@ -55,36 +55,36 @@ if has('gui_running')
55
55
else
56
56
" preset 16 vt100 colors
57
57
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 ]]
74
74
75
75
" the 6 values used in the xterm color cube
76
76
" 0 95 135 175 215 255
77
77
let s: cubergb = [ 0x00 , 0x5F , 0x87 , 0xAF , 0xD7 , 0xFF ]
78
78
for s: rrr in s: cubergb
79
79
for s: ggg in s: cubergb
80
80
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 ] )
82
82
endfor
83
83
endfor
84
84
endfor
85
85
86
86
" 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 ) ' )
88
88
89
89
" selects the nearest xterm color for a rgb value like #FF0000
90
90
function ! s: rgb2xterm (color )
95
95
let g = s: hex [color [2 :3 ]]
96
96
let b = s: hex [color [4 :5 ]]
97
97
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]
99
100
let dr = tr - r
100
101
let dg = tg - g
101
102
let db = tb - b
0 commit comments