style: fixed some sumneko diagnostics error

This commit is contained in:
Folke Lemaitre
2022-09-13 16:44:55 +02:00
parent dd2d0d2570
commit 3e79e043df
2 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ local M = {}
---@field fg string|nil
---@field bg string|nil
---@field sp string|nil
---@field style string|nil
---@field style string|nil|Highlight
---@alias Highlights table<string,Highlight>

View File

@@ -12,12 +12,12 @@ local function hexToRgb(c)
return { tonumber(c:sub(2, 3), 16), tonumber(c:sub(4, 5), 16), tonumber(c:sub(6, 7), 16) }
end
---@param fg string foreground color
---@param bg string background color
---@param foreground string foreground color
---@param background string background color
---@param alpha number number between 0 and 1. 0 results in bg, 1 results in fg
function M.blend(fg, bg, alpha)
bg = hexToRgb(bg)
fg = hexToRgb(fg)
function M.blend(foreground, background, alpha)
local bg = hexToRgb(background)
local fg = hexToRgb(foreground)
local blendChannel = function(i)
local ret = (alpha * fg[i] + ((1 - alpha) * bg[i]))