Skip to content

Commit

Permalink
update change_hex_hue function
Browse files Browse the repository at this point in the history
  • Loading branch information
siduck committed Aug 6, 2024
1 parent b6fd2a3 commit aa11fb8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lua/base46/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,11 @@ end
-- @return The hex color value
M.change_hex_hue = function(hex, percent)
local h, s, l = M.hex2hsl(hex)
h = h + (percent / 100)
if h > 360 then
h = 360
end
-- Convert percentage to a degree shift
local shift = (percent / 100) * 360
h = (h + shift) % 360
if h < 0 then
h = 0
h = h + 360
end
return M.hsl2hex(h, s, l)
end
Expand Down

0 comments on commit aa11fb8

Please sign in to comment.