9
9
"
10
10
" color conversion algorithms adapted from http://www.cs.rit.edu/~ncs/color/t_convert.html
11
11
12
- function ! s: RGB2HSV (r , g , b ) " {{{2
12
+ function ! s: RGB2HSV (r , g , b ) abort " {{{2
13
13
let rp = a: r /255.0
14
14
let gp = a: g /255.0
15
15
let bp = a: b /255.0
@@ -37,7 +37,7 @@ function! s:RGB2HSV(r, g, b) "{{{2
37
37
return [h , s , v ]
38
38
endfunction
39
39
40
- function ! s: HSV2RGB (h , s , v ) " {{{2
40
+ function ! s: HSV2RGB (h , s , v ) abort " {{{2
41
41
if a: s == 0 " achromatic
42
42
return [a: v , a: v , a: v ]
43
43
endif
@@ -76,15 +76,15 @@ function! s:HSV2RGB(h, s, v) "{{{2
76
76
return [float2nr (r * 255 ), float2nr (g * 255 ), float2nr (b * 255 )]
77
77
endfunction
78
78
79
- function ! s: Hex2RGB (hex) " {{{2
79
+ function ! s: Hex2RGB (hex) abort " {{{2
80
80
let hex = split (a: hex , ' \zs' )
81
81
let h_r = ' 0x' .join (hex[:1 ], ' ' )
82
82
let h_g = ' 0x' .join (hex[2 :3 ], ' ' )
83
83
let h_b = ' 0x' .join (hex[4 :6 ], ' ' )
84
84
return map ([h_r, h_g, h_b], ' eval(v:val)' )
85
85
endfunction
86
86
87
- function ! s: RGB2Hex (r , g , b ) " {{{2
87
+ function ! s: RGB2Hex (r , g , b ) abort " {{{2
88
88
let h_r = printf (' %02x' , a: r )
89
89
let h_g = printf (' %02x' , a: g )
90
90
let h_b = printf (' %02x' , a: b )
@@ -93,7 +93,7 @@ endfunction
93
93
94
94
" Instrospection: {{{1
95
95
96
- function ! pandoc#syntax#color#Instrospect (group)
96
+ function ! pandoc#syntax#color#Instrospect (group) abort
97
97
redir = > hi_output
98
98
exe ' silent hi ' . a: group
99
99
redir END
@@ -114,7 +114,7 @@ endfunction
114
114
115
115
" Palette: {{{1
116
116
117
- function ! pandoc#syntax#color#SaturationPalette (hex, partitions)
117
+ function ! pandoc#syntax#color#SaturationPalette (hex, partitions) abort
118
118
let rgb = s: Hex2RGB (a: hex )
119
119
let hsv = s: RGB2HSV (rgb[0 ], rgb[1 ], rgb[2 ])
120
120
let hsv_palette = []
0 commit comments