feat: improved tokyonight moon (based on moonlight theme) palette

This commit is contained in:
Folke Lemaitre
2022-09-19 06:47:39 +02:00
parent 1d1d1722e0
commit 9bc8f4e8f0
2 changed files with 75 additions and 60 deletions

View File

@@ -14,8 +14,9 @@ end
---@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
---@param alpha number|string number between 0 and 1. 0 results in bg, 1 results in fg
function M.blend(foreground, background, alpha)
alpha = type(alpha) == "string" and (tonumber(alpha, 16) / 0xff) or alpha
local bg = hexToRgb(background)
local fg = hexToRgb(foreground)
@@ -28,11 +29,11 @@ function M.blend(foreground, background, alpha)
end
function M.darken(hex, amount, bg)
return M.blend(hex, bg or M.bg, math.abs(amount))
return M.blend(hex, bg or M.bg, amount)
end
function M.lighten(hex, amount, fg)
return M.blend(hex, fg or M.fg, math.abs(amount))
return M.blend(hex, fg or M.fg, amount)
end
function M.invert_color(color)