feat: callbacks to easily override (or add) colors and highlights

This commit is contained in:
Folke Lemaitre
2022-09-05 20:32:31 +02:00
parent ec13e0f44f
commit 12649d34fe
5 changed files with 71 additions and 91 deletions

View File

@@ -47,7 +47,7 @@ function M.setup(opts)
colors.bg_dark = "#16161e"
end
util.bg = colors.bg
util.day_brightness = config.dayBrightness
util.day_brightness = config.day_brightness
colors.diff = {
add = util.darken(colors.green2, 0.15),
@@ -72,8 +72,13 @@ function M.setup(opts)
colors.bg_statusline = colors.bg_dark
-- Sidebar and Floats are configurable
colors.bg_sidebar = (config.transparentSidebar and colors.none) or config.darkSidebar and colors.bg_dark or colors.bg
colors.bg_float = config.darkFloat and colors.bg_dark or colors.bg
colors.bg_sidebar = config.styles.sidebars == "transparent" and colors.none
or config.styles.sidebars == "dark" and colors.bg_dark
or colors.bg
colors.bg_float = config.styles.floats == "transparent" and colors.none
or config.styles.floats == "dark" and colors.bg_dark
or colors.bg
colors.bg_visual = util.darken(colors.blue0, 0.7)
colors.bg_search = colors.blue0
@@ -84,8 +89,7 @@ function M.setup(opts)
colors.info = colors.blue2
colors.hint = colors.teal
util.color_overrides(colors, config)
config.on_colors(colors)
if opts.transform and (config.style == "day" or vim.o.background == "light") then
util.invert_colors(colors)
end