Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(utils): blend returns the other value when one value is 'NONE' #105

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/nordic.nvim.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*nordic.nvim.txt* For NVIM v0.8.0 Last change: 2024 January 04
*nordic.nvim.txt* For NVIM v0.8.0 Last change: 2024 January 06

==============================================================================
Table of Contents *nordic.nvim-table-of-contents*
Expand Down
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