Skip to content

Commit

Permalink
fix(utils:blend) returns the non-none value when one of the arguments…
Browse files Browse the repository at this point in the history
… is none.
  • Loading branch information
5-pebbles committed Jan 6, 2024
1 parent 55a7595 commit bf3c3bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/nordic/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ end

-- Adapted from @folke/tokyonight.nvim.
function M.blend(foreground, background, alpha)
if foreground == 'NONE' or background == 'NONE' then return 'NONE' end
if foreground == 'NONE' then
return background
elseif background == 'NONE' then
return foreground
end

local fg = { M.hex_to_rgb(foreground) }
local bg = { M.hex_to_rgb(background) }
Expand Down

0 comments on commit bf3c3bc

Please sign in to comment.