Skip to content

Commit

Permalink
fix(shader): always allow shading to a neutral color (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramojus committed Nov 2, 2024
1 parent 538f94e commit 07489d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/mellifluous/utils/shader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function M.replicate_shade(from_color, to_color, target)
local target_hsl = target:get_hsl()
if target_hsl.h and from_hsl.h and to_hsl.h then
target_hsl.h = clip(target_hsl.h + to_hsl.h - from_hsl.h, 0, 360)
elseif to_hsl.h == nil then
target_hsl.h = nil
elseif from_hsl.h ~= to_hsl.h then
require("mellifluous").return_error(
"this shade changes hue, but at least one of the colors is neutral, without hue"
Expand Down

0 comments on commit 07489d2

Please sign in to comment.