diff --git a/lua/avante/highlights.lua b/lua/avante/highlights.lua index 44a954a..621d932 100644 --- a/lua/avante/highlights.lua +++ b/lua/avante/highlights.lua @@ -124,11 +124,12 @@ H.alter = function(attr, percent) return math.floor(attr * (100 + percent) / 100 ---@source https://stackoverflow.com/q/5560248 ---@see https://stackoverflow.com/a/37797380 ----Darken a specified hex color +---Lighten a specified hex color ---@param color number ---@param percent number ---@return string H.shade_color = function(color, percent) + percent = vim.opt.background:get() == "light" and percent / 10 or percent local rgb = H.decode_24bit_rgb(color) if not rgb.r or not rgb.g or not rgb.b then return "NONE" end local r, g, b = H.alter(rgb.r, percent), H.alter(rgb.g, percent), H.alter(rgb.b, percent)