-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(highlights): use custom highlight groups
- Loading branch information
Showing
11 changed files
with
128 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
local M = {} | ||
|
||
-- Any shared highlight groups that cannot be found in general highlights or | ||
-- treesitter highlights are created here. | ||
|
||
function M.get(colors) | ||
local config = require('mellifluous.config').config | ||
local shader = require('mellifluous.utils.shader') | ||
|
||
return { | ||
MainKeyword = { fg = colors.main_keywords, style = config.styles.keywords }, | ||
|
||
IndentLine = function(bg) | ||
return { fg = shader.replicate_shade(colors.bg, colors.fg4, bg) } | ||
end, | ||
IndentLineActive = function(bg) | ||
return { fg = shader.replicate_shade(colors.bg, colors.fg5, bg) } | ||
end, | ||
IndentLineInactive = function(bg) | ||
return { | ||
fg = config.is_bg_dark | ||
and shader.replicate_shade(colors.bg, colors.bg4, bg) | ||
or shader.replicate_shade(colors.bg, colors.dark_bg2, bg) | ||
} | ||
end, | ||
|
||
MenuButton = { fg = colors.ui_blue }, | ||
MenuButtonSelected = function(bg) | ||
local applied_bg = config.is_bg_dark | ||
and shader.replicate_shade(colors.bg, colors.bg4, bg) | ||
or shader.replicate_shade(colors.bg, colors.dark_bg2, bg) | ||
return { | ||
fg = shader.replicate_shade(colors.bg, applied_bg, colors.ui_blue), | ||
bg = applied_bg, | ||
} | ||
end, | ||
|
||
FileTree = { | ||
fg = colors.fg2, | ||
bg = (config.transparent_background.file_tree | ||
and 'NONE') | ||
or config.flat_background.file_tree | ||
and colors.bg | ||
or colors.dark_bg | ||
}, | ||
FileTreeWinSeparator = function(bg) | ||
return { | ||
fg = config.flat_background.line_numbers ~= config.flat_background.file_tree | ||
and bg -- no separator if LineNr bg differs from this bg | ||
or config.flat_background.line_numbers and config.flat_background.file_tree | ||
and colors.fg5 -- stronger separator if both bg are flat | ||
or config.is_bg_dark | ||
and colors.bg3 | ||
or colors.dark_bg2, | ||
|
||
bg = bg, | ||
} | ||
end, | ||
} | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.