mirror of
https://github.com/gabehf/base46.git
synced 2026-03-17 03:06:30 -07:00
minor fixes
This commit is contained in:
parent
45421bc921
commit
896a4a9271
5 changed files with 100 additions and 33 deletions
|
|
@ -23,28 +23,26 @@ if polish_hl then
|
||||||
end
|
end
|
||||||
|
|
||||||
-- override user highlights if there are any
|
-- override user highlights if there are any
|
||||||
if ui.hl_override then
|
local user_highlights = ui.hl_override
|
||||||
local user_highlights = ui.hl_override
|
local colors = require("base46").get_theme_tb "base_30"
|
||||||
local colors = require("base46").get_theme_tb "base_30"
|
|
||||||
|
|
||||||
-- fg = "white" set by user becomes fg = colors["white"]
|
-- fg = "white" set by user becomes fg = colors["white"]
|
||||||
-- so no need for the user to import colors
|
-- so no need for the user to import colors
|
||||||
|
|
||||||
for group, _ in pairs(user_highlights) do
|
for group, _ in pairs(user_highlights) do
|
||||||
for key, val in pairs(user_highlights[group]) do
|
for key, val in pairs(user_highlights[group]) do
|
||||||
if key == "fg" or key == "bg" then
|
if key == "fg" or key == "bg" then
|
||||||
if val:sub(1, 1) == "#" or val == "none" or val == "NONE" then
|
if val:sub(1, 1) == "#" or val == "none" or val == "NONE" then
|
||||||
user_highlights[group][key] = val
|
user_highlights[group][key] = val
|
||||||
else
|
else
|
||||||
user_highlights[group][key] = colors[val]
|
user_highlights[group][key] = colors[val]
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
highlights = merge_tb(highlights, user_highlights)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
highlights = merge_tb(highlights, user_highlights)
|
||||||
|
|
||||||
-- local set_transparent = nvchad.load_config().ui.transparency
|
-- local set_transparent = nvchad.load_config().ui.transparency
|
||||||
if vim.g.transparency then
|
if vim.g.transparency then
|
||||||
highlights = merge_tb(highlights, require "base46.glassy")
|
highlights = merge_tb(highlights, require "base46.glassy")
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,9 @@ end
|
||||||
M.load_all_highlights = function()
|
M.load_all_highlights = function()
|
||||||
-- reload highlights for theme switcher
|
-- reload highlights for theme switcher
|
||||||
local reload = require("plenary.reload").reload_module
|
local reload = require("plenary.reload").reload_module
|
||||||
local clear_hl = require("base46").clear_highlights
|
|
||||||
|
|
||||||
clear_hl "BufferLine"
|
M.clear_highlights "BufferLine"
|
||||||
clear_hl "TS"
|
M.clear_highlights "TS"
|
||||||
|
|
||||||
reload "base46.integrations"
|
reload "base46.integrations"
|
||||||
reload "base46.chadlights"
|
reload "base46.chadlights"
|
||||||
|
|
@ -54,21 +53,64 @@ M.load_all_highlights = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
M.load_highlight = function(group)
|
M.turn_str_to_color = function(tb)
|
||||||
local default_hl = require("base46.integrations." .. group)
|
local colors = M.get_theme_tb "base_30"
|
||||||
local user_hl = config.ui.hl_override
|
|
||||||
|
|
||||||
if vim.g.transparency then
|
for _, groups in pairs(tb) do
|
||||||
user_hl = M.merge_tb(user_hl, require "base46.glassy")
|
for k, v in pairs(groups) do
|
||||||
end
|
if k == "fg" or k == "bg" then
|
||||||
|
if v:sub(1, 1) == "#" or v == "none" or v == "NONE" then
|
||||||
for key, value in pairs(user_hl) do
|
else
|
||||||
if default_hl[key] then
|
groups[k] = colors[v]
|
||||||
default_hl[key] = value
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for hl, col in pairs(default_hl) do
|
return tb
|
||||||
|
end
|
||||||
|
|
||||||
|
M.extend_default_hl = function(highlights)
|
||||||
|
local glassy = require "base46.glassy"
|
||||||
|
local polish_hl = M.get_theme_tb "polish_hl"
|
||||||
|
|
||||||
|
if polish_hl then
|
||||||
|
-- polish themes
|
||||||
|
for key, value in pairs(polish_hl) do
|
||||||
|
if highlights[key] then
|
||||||
|
highlights[key] = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- transparency
|
||||||
|
if vim.g.transparency then
|
||||||
|
-- highlights_tb = M.merge_tb(highlights_tb,)
|
||||||
|
for key, value in pairs(glassy) do
|
||||||
|
if highlights[key] then
|
||||||
|
highlights[key] = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local overriden_hl = M.turn_str_to_color(config.ui.hl_override)
|
||||||
|
|
||||||
|
for key, value in pairs(overriden_hl) do
|
||||||
|
if highlights[key] then
|
||||||
|
highlights[key] = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
M.load_highlight = function(group)
|
||||||
|
if type(group) == "string" then
|
||||||
|
group = require("base46.integrations." .. group)
|
||||||
|
M.extend_default_hl(group)
|
||||||
|
else
|
||||||
|
group = group
|
||||||
|
end
|
||||||
|
|
||||||
|
for hl, col in pairs(group) do
|
||||||
vim.api.nvim_set_hl(0, hl, col)
|
vim.api.nvim_set_hl(0, hl, col)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -80,6 +122,7 @@ M.load_theme = function()
|
||||||
|
|
||||||
M.load_highlight "defaults"
|
M.load_highlight "defaults"
|
||||||
M.load_highlight "statusline"
|
M.load_highlight "statusline"
|
||||||
|
M.load_highlight(M.turn_str_to_color(config.ui.hl_add))
|
||||||
end
|
end
|
||||||
|
|
||||||
M.override_theme = function(default_theme, theme_name)
|
M.override_theme = function(default_theme, theme_name)
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ return {
|
||||||
fg = theme.base09,
|
fg = theme.base09,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Variable = {
|
||||||
|
fg = theme.base05,
|
||||||
|
},
|
||||||
|
|
||||||
Function = {
|
Function = {
|
||||||
fg = theme.base0D,
|
fg = theme.base0D,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,16 @@ return {
|
||||||
sp = "none",
|
sp = "none",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
TSKeywordFunction = {
|
||||||
|
fg = theme.base0E,
|
||||||
|
sp = "none",
|
||||||
|
},
|
||||||
|
|
||||||
|
TSKeywordReturn = {
|
||||||
|
fg = theme.base0E,
|
||||||
|
sp = "none",
|
||||||
|
},
|
||||||
|
|
||||||
TSFuncBuiltin = {
|
TSFuncBuiltin = {
|
||||||
fg = theme.base0D,
|
fg = theme.base0D,
|
||||||
sp = "none",
|
sp = "none",
|
||||||
|
|
@ -152,6 +162,10 @@ return {
|
||||||
sp = "none",
|
sp = "none",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
TSVariable = {
|
||||||
|
fg = theme.base05,
|
||||||
|
},
|
||||||
|
|
||||||
TSDefinition = {
|
TSDefinition = {
|
||||||
sp = theme.base04,
|
sp = theme.base04,
|
||||||
underline = true,
|
underline = true,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ M.base_30 = {
|
||||||
pink = "#bb7cb6",
|
pink = "#bb7cb6",
|
||||||
line = "#2e2e2e", -- for lines like vertsplit
|
line = "#2e2e2e", -- for lines like vertsplit
|
||||||
green = "#B5CEA8",
|
green = "#B5CEA8",
|
||||||
|
green1 = "#4EC994",
|
||||||
vibrant_green = "#bfd8b2",
|
vibrant_green = "#bfd8b2",
|
||||||
blue = "#569CD6",
|
blue = "#569CD6",
|
||||||
nord_blue = "#60a6e0",
|
nord_blue = "#60a6e0",
|
||||||
|
|
@ -24,7 +25,7 @@ M.base_30 = {
|
||||||
sun = "#e1c487",
|
sun = "#e1c487",
|
||||||
purple = "#c68aee",
|
purple = "#c68aee",
|
||||||
dark_purple = "#b77bdf",
|
dark_purple = "#b77bdf",
|
||||||
teal = "#4EC994",
|
teal = "#4294D6",
|
||||||
orange = "#d3967d",
|
orange = "#d3967d",
|
||||||
cyan = "#9CDCFE",
|
cyan = "#9CDCFE",
|
||||||
statusline_bg = "#242424",
|
statusline_bg = "#242424",
|
||||||
|
|
@ -50,10 +51,13 @@ M.base_16 = {
|
||||||
base0C = "#9CDCFE",
|
base0C = "#9CDCFE",
|
||||||
base0D = "#DCDCAA",
|
base0D = "#DCDCAA",
|
||||||
base0E = "#C586C0",
|
base0E = "#C586C0",
|
||||||
base0F = "#CE9178",
|
base0F = "#E9E9E9",
|
||||||
}
|
}
|
||||||
|
|
||||||
M.polish_hl = {
|
M.polish_hl = {
|
||||||
|
TSParameter = {
|
||||||
|
fg = M.base_30.blue,
|
||||||
|
},
|
||||||
|
|
||||||
TSKeyword = {
|
TSKeyword = {
|
||||||
fg = M.base_30.blue,
|
fg = M.base_30.blue,
|
||||||
|
|
@ -64,16 +68,20 @@ M.polish_hl = {
|
||||||
},
|
},
|
||||||
|
|
||||||
luaTSField = {
|
luaTSField = {
|
||||||
fg = M.base_30.red,
|
fg = M.base_30.teal,
|
||||||
},
|
},
|
||||||
|
|
||||||
TSFieldKey = {
|
TSFieldKey = {
|
||||||
fg = M.base_30.teal,
|
fg = M.base_30.green1,
|
||||||
},
|
},
|
||||||
|
|
||||||
TSKeywordReturn = {
|
TSKeywordReturn = {
|
||||||
fg = M.base_16.base0E,
|
fg = M.base_16.base0E,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
TSKeywordFunction = {
|
||||||
|
fg = M.base_30.teal,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
M.type = "dark"
|
M.type = "dark"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue