Skip to content

Commit 1dd82f9

Browse files
committed
feat: add better colors for cmp atom_colored theme
1 parent 0dc134f commit 1dd82f9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lua/base46/integrations/cmp.lua

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local base16 = require("base46").get_theme_tb "base_16"
22
local colors = require("base46").get_theme_tb "base_30"
3+
local mixcolors = require("base46.colors").mix
34

45
local highlights = {
56
CmpItemAbbr = { fg = colors.white },
@@ -43,6 +44,7 @@ local item_kinds = {
4344
CmpItemKindCopilot = { fg = colors.green },
4445
CmpItemKindCodeium = { fg = colors.vibrant_green },
4546
CmpItemKindTabNine = { fg = colors.baby_pink },
47+
CmpItemKindSuperMaven = { fg = colors.yellow },
4648
}
4749

4850
local cmp_ui = require("nvconfig").ui.cmp
@@ -96,21 +98,20 @@ local styles = {
9698

9799
local generate_color = require("base46.colors").change_hex_lightness
98100

101+
local black2_l = generate_color(colors.black2, 6)
102+
local black2_d = generate_color(colors.black2, -6)
103+
99104
-- override item_kind highlights for atom style
100105
if cmp_ui.style == "atom" then
101106
for key, value in pairs(item_kinds) do
102-
item_kinds[key] = vim.tbl_deep_extend(
103-
"force",
104-
value,
105-
{ bg = vim.o.bg == "dark" and generate_color(colors.black2, 6) or generate_color(colors.black2, -6) }
106-
)
107+
item_kinds[key] = vim.tbl_deep_extend("force", value, { bg = vim.o.bg == "dark" and black2_l or black2_d })
107108
end
108109
end
109110

110111
-- override item_kind highlights for atom_colored style
111112
if cmp_ui.style == "atom_colored" then
112113
for key, value in pairs(item_kinds) do
113-
item_kinds[key] = { fg = colors.black, bg = generate_color(value.fg, -3), bold = true }
114+
item_kinds[key] = { fg = value.fg, bg = mixcolors(value.fg, colors.black, 70) }
114115
end
115116
end
116117

0 commit comments

Comments
 (0)