Fixed using 'auto' theme with default colorscheme.
When setting theme to 'auto' and using the default colorscheme, lualine would report "theme not found, defaulting to gruvbox". Fixed by checking that we get an actual color back when calling utils.extract_highlight_colors before attempting to apply a brightness modifier. * Fix brightness_modifier application. The brightness_modifer() should only be applied when a normal color was found. * Apply brightness modifier when normal color not nil. Moved application of brightness_modifier outside the if statement that negates the brightness modifier. The modifier will now be applied when get_color_brightness returns < 0.5.
This commit is contained in:
parent
e544b47895
commit
f1dbb2f4a8
|
@ -117,12 +117,14 @@ local colors = {
|
||||||
-- Change brightness of colors
|
-- Change brightness of colors
|
||||||
-- darken incase of light theme lighten incase of dark theme
|
-- darken incase of light theme lighten incase of dark theme
|
||||||
|
|
||||||
if get_color_brightness(utils.extract_highlight_colors('Normal', 'bg')) > 0.5 then
|
local normal_color = utils.extract_highlight_colors('Normal', 'bg')
|
||||||
brightness_modifier_parameter = -brightness_modifier_parameter
|
if normal_color ~= nil then
|
||||||
end
|
if get_color_brightness(normal_color) > 0.5 then
|
||||||
|
brightness_modifier_parameter = -brightness_modifier_parameter
|
||||||
for name, color in pairs(colors) do
|
end
|
||||||
colors[name] = brightness_modifier(color, brightness_modifier_parameter)
|
for name, color in pairs(colors) do
|
||||||
|
colors[name] = brightness_modifier(color, brightness_modifier_parameter)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- basic theme defination
|
-- basic theme defination
|
||||||
|
|
Loading…
Reference in New Issue