|
32 | 32 | ---@return RGB rgb_table |
33 | 33 | --- FIXME: this currently does not support transparent backgrounds. Need a replacement for bg_rgb |
34 | 34 | function M.rgba_to_rgb(rgba, bg_rgb) |
35 | | - if vim.fn.has("nvim-0.11") then |
| 35 | + if vim.fn.has("nvim-0.11") == 1 then |
36 | 36 | vim.validate("rgba", rgba, "table", true) |
37 | 37 | vim.validate("bg_rgb", bg_rgb, "table", false) |
38 | 38 | vim.validate("r", rgba.r, "number", true) |
|
70 | 70 | ---@param rgb RGB with keys 'r', 'g', 'b' in [0,255] |
71 | 71 | ---@return string 6 digit hex representing the rgb params |
72 | 72 | local function rgb_to_hex(rgb) |
73 | | - if vim.fn.has("nvim-0.11") then |
| 73 | + if vim.fn.has("nvim-0.11") == 1 then |
74 | 74 | vim.validate("rgb", rgb, "table", false) |
75 | 75 | vim.validate("r", rgb.r, "number", false) |
76 | 76 | vim.validate("g", rgb.g, "number", false) |
@@ -98,7 +98,7 @@ function M.rgba_to_hex(rgba, bg_rgb) return rgb_to_hex(M.rgba_to_rgb(rgba, bg_rg |
98 | 98 | ---@param rgb_24bit number 24-bit RGB value |
99 | 99 | ---@return RGB |
100 | 100 | function M.decode_24bit_rgb(rgb_24bit) |
101 | | - if vim.fn.has("nvim-0.11") then |
| 101 | + if vim.fn.has("nvim-0.11") == 1 then |
102 | 102 | vim.validate("rgb_24bit", rgb_24bit, "number", true) |
103 | 103 | else |
104 | 104 | vim.validate({ rgb_24bit = { rgb_24bit, "number", true } }) |
|
219 | 219 | ---@param color_infos table of `ColorInformation` objects to highlight. |
220 | 220 | -- See https://microsoft.github.io/language-server-protocol/specification#textDocument_documentColor |
221 | 221 | function M.buf_color(client_id, bufnr, color_infos, _) |
222 | | - if vim.fn.has("nvim-0.11") then |
| 222 | + if vim.fn.has("nvim-0.11") == 1 then |
223 | 223 | vim.validate("bufnr", bufnr, "number", true) |
224 | 224 | vim.validate("color_infos", color_infos, "table", true) |
225 | 225 | else |
|
250 | 250 | ---@param client_id number client id |
251 | 251 | ---@param bufnr number buffer id |
252 | 252 | function M.buf_clear_color(client_id, bufnr) |
253 | | - if vim.fn.has("nvim-0.11") then |
| 253 | + if vim.fn.has("nvim-0.11") == 1 then |
254 | 254 | vim.validate("client_id", client_id, "number", true) |
255 | 255 | vim.validate("bufnr", bufnr, "number", true) |
256 | 256 | else |
|
0 commit comments