Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: config option 'overrides' to override palette colors #40

Merged
merged 5 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lua/gruvbox-baby/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ function M.config(config)
}
colors = vim.tbl_extend("force", colors, transparent)
end

if config.overrides then
for override_color, new_color in pairs(config.overrides) do
if new_color:match("^%a") then -- use existing palette color
new_color = colors[new_color]
end
gaoDean marked this conversation as resolved.
Show resolved Hide resolved
colors[override_color] = new_color
end
end
return colors
end

Expand Down
1 change: 1 addition & 0 deletions lua/gruvbox-baby/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ config = {
string_style = opt("string_style", "nocombine"),
variable_style = opt("variable_style", "NONE"),
highlights = opt("highlights", {}),
overrides = opt("overrides", {}),
telescope_theme = opt("telescope_theme", false),
gaoDean marked this conversation as resolved.
Show resolved Hide resolved
transparent_mode = opt("transparent_mode", false),
use_original_palette = opt("use_original_palette", false),
Expand Down