mirror of https://github.com/sgoudham/nvim.git
Merge branch 'vihu-rg/dim-inactive'
commit
ecf4936512
@ -1,29 +1,33 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.get(cp)
|
function M.get(cp)
|
||||||
local transparent_background = require("catppuccin.config").options.transparent_background
|
local cnf = require("catppuccin.config").options
|
||||||
local bg_highlight = transparent_background and "NONE" or cp.base
|
local transparent_background = cnf.transparent_background
|
||||||
|
local bg_highlight = (transparent_background and cnf.dim_inactive.enable and cp.dim)
|
||||||
|
or (transparent_background and "NONE")
|
||||||
|
or (cnf.dim_inactive.enable and cp.dim)
|
||||||
|
or cp.base
|
||||||
|
|
||||||
local inactive_bg = transparent_background and "NONE" or cp.mantle
|
local inactive_bg = transparent_background and "NONE" or cp.mantle
|
||||||
|
|
||||||
return {
|
return {
|
||||||
BufferLineFill = { bg = bg_highlight },
|
BufferLineFill = { bg = bg_highlight },
|
||||||
BufferLineBackcrust = { fg = cp.text, bg = inactive_bg }, -- others
|
BufferLineBackcrust = { fg = cp.text, bg = inactive_bg }, -- others
|
||||||
BufferLineBufferVisible = { fg = cp.surface1, bg = inactive_bg },
|
BufferLineBufferVisible = { fg = cp.surface1, bg = inactive_bg },
|
||||||
BufferLineBufferSelected = { fg = cp.text, bg = cp.base, style = "bold,italic" }, -- current
|
BufferLineBufferSelected = { fg = cp.text, bg = cp.base, style = "bold,italic" }, -- current
|
||||||
BufferLineTab = { fg = cp.surface1, bg = cp.base },
|
BufferLineTab = { fg = cp.surface1, bg = cp.base },
|
||||||
BufferLineTabSelected = { fg = cp.red, bg = cp.blue },
|
BufferLineTabSelected = { fg = cp.red, bg = cp.blue },
|
||||||
BufferLineTabClose = { fg = cp.red, bg = inactive_bg },
|
BufferLineTabClose = { fg = cp.red, bg = inactive_bg },
|
||||||
BufferLineIndicatorSelected = { fg = cp.peach, bg = cp.base },
|
BufferLineIndicatorSelected = { fg = cp.peach, bg = cp.base },
|
||||||
-- separators
|
-- separators
|
||||||
BufferLineSeparator = { fg = inactive_bg, bg = inactive_bg },
|
BufferLineSeparator = { fg = inactive_bg, bg = inactive_bg },
|
||||||
BufferLineSeparatorVisible = { fg = inactive_bg, bg = inactive_bg },
|
BufferLineSeparatorVisible = { fg = inactive_bg, bg = inactive_bg },
|
||||||
BufferLineSeparatorSelected = { fg = inactive_bg, bg = inactive_bg },
|
BufferLineSeparatorSelected = { fg = inactive_bg, bg = inactive_bg },
|
||||||
-- close buttons
|
-- close buttons
|
||||||
BufferLineCloseButton = { fg = cp.surface1, bg = inactive_bg },
|
BufferLineCloseButton = { fg = cp.surface1, bg = inactive_bg },
|
||||||
BufferLineCloseButtonVisible = { fg = cp.surface1, bg = inactive_bg },
|
BufferLineCloseButtonVisible = { fg = cp.surface1, bg = inactive_bg },
|
||||||
BufferLineCloseButtonSelected = { fg = cp.red, bg = cp.base },
|
BufferLineCloseButtonSelected = { fg = cp.red, bg = cp.base },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
local cp = require("catppuccin.core.palettes.init").get_palette()
|
||||||
|
local cnf = require("catppuccin.config").options
|
||||||
|
local dim_percentage = cnf.dim_inactive.percentage
|
||||||
|
local ucolors = require("catppuccin.ucolors.ucolors")
|
||||||
|
|
||||||
|
function M.dim()
|
||||||
|
if cnf.dim_inactive.shade == "dark" then
|
||||||
|
return ucolors.darken(cp.base, dim_percentage, cp.crust)
|
||||||
|
end
|
||||||
|
return ucolors.lighten(cp.base, dim_percentage, cp.surface0)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
Loading…
Reference in New Issue