This commit is contained in:
2025-09-25 07:22:36 +00:00
parent f4c3f38078
commit dd738ade40
19 changed files with 516 additions and 300 deletions

View File

@@ -0,0 +1,19 @@
local M = {}
function M.get(P)
local colors = {
base = P.white,
surface = P.gray_light,
text = P.black,
muted = P.gray,
accent = P.blue,
accent_light = P.blue_light,
syntax = 60,
none = "NONE",
}
return vim.tbl_extend("force", P, colors)
end
return M

View File

@@ -0,0 +1,37 @@
local M = {}
function M.get(C)
return {
Normal = { fg = C.text, bg = C.none },
LineNr = { fg = C.muted },
CursorLineNr = { fg = C.accent, bold = true },
CursorLine = { bg = C.surface },
Visual = { bg = C.accent_light },
Search = { fg = C.yellow },
CurSearch = { fg = C.base, bg = C.yellow, bold = true },
IncSearch = { fg = C.base, bg = C.yellow, bold = true },
MatchParen = { fg = C.base, bg = C.accent },
EndOfBuffer = { fg = C.base }, -- End-of-buffer marker (~ lines)
WinSeparator = { fg = C.muted },
StatusLine = { fg = C.muted, bg = C.none }, -- Active statusline (where filename)
MsgArea = { fg = C.text, bg = C.none }, -- Command-line / message area
MsgSeparator = { fg = C.text, bg = C.surface }, -- Separator for messages
ModeMsg = { fg = C.text },
TabLine = { fg = C.muted }, -- Unselected tab
TabLineSel = { fg = C.text, bold = true }, -- Selected tab
TabLineFill = { bg = C.none }, -- Empty space in the tabline
-- DiagnosticError = { undercurl = true, sp = C.red },
-- DiagnosticWarn = { undercurl = true, sp = C.yellow },
-- DiagnosticInfo = { underline = true, sp = C.accent },
-- DiagnosticHint = { underline = true, sp = C.green },
Directory = { fg = C.accent },
}
end
return M

View File

@@ -0,0 +1,13 @@
local M = {}
function M.get(C)
return {
NvimTreeFolderIcon = { fg = C.accent },
NvimTreeRootFolder = { fg = C.text, bold = true },
-- NvimTreeOpenedHL = { bg = C.surface },
}
end
return M

View File

@@ -0,0 +1,13 @@
local M = {}
function M.get(C)
return {
-- TelescopeBorder = { fg = C.muted, bg = C.green },
-- TelescopeNormal = { fg = C.text, bg = C.base, ctermbg = 1 },
TelescopePrompt = { fg = C.text, bg = C.base, ctermbg = 1 },
-- TelescopePromptPrefix = { fg = C.accent, bg = C.red },
-- TelescopeSelection = { bg = C.surface },
}
end
return M

View File

@@ -0,0 +1,19 @@
local M = {}
function M.get(C)
local theme = {
["@comment"] = { fg = C.muted, italic = true },
}
for _, hl in ipairs(vim.fn.getcompletion("@", "highlight")) do
if theme[hl] == nil then
theme[hl] = { fg = C.syntax }
end
end
return theme
end
return M

View File

@@ -0,0 +1,9 @@
local M = {}
-- fallback for vim without tree-sitter
function M.get(C)
return {}
end
return M

View File

@@ -0,0 +1,31 @@
local M = {}
function M.get(C)
return {
terminal_color_0 = { fg = C.black },
terminal_color_8 = { fg = C.black },
terminal_color_1 = { fg = C.red },
terminal_color_9 = { fg = C.red },
terminal_color_2 = { fg = C.green },
terminal_color_10 = { fg = C.green },
terminal_color_3 = { fg = C.yellow },
terminal_color_11 = { fg = C.yellow },
terminal_color_4 = { fg = C.blue },
terminal_color_12 = { fg = C.blue },
terminal_color_5 = { fg = C.magenta },
terminal_color_13 = { fg = C.magenta },
terminal_color_6 = { fg = C.cyan },
terminal_color_14 = { fg = C.cyan },
terminal_color_7 = { fg = C.white },
terminal_color_15 = { fg = C.white },
}
end
return M

View File

@@ -0,0 +1,12 @@
local M = {
name = "invero",
variant = "light",
}
function M.load()
local setup = require("themes." .. M.name .. ".setup")
setup.reset(M)
setup.apply(M)
end
return M

View File

@@ -0,0 +1,37 @@
local M = {}
function M.get()
return {
black = 0,
gray = 247,
gray_light = 253,
red = 1,
green = 2,
yellow = 3,
yellow_light = 180,
blue = 4,
blue_light = 153,
magenta = 5,
cyan = 6,
white = 7,
}
-- return {
-- black = 238,
-- gray = 247,
-- gray_light = 253,
-- red = 196,
-- green = 35,
-- yellow = 221,
-- orange = 166,
-- orange_light = 180,
-- blue = 27,
-- blue_light = 153,
-- magenta = 125,
-- cyan = 30,
-- white = 255,
-- }
end
return M

View File

@@ -0,0 +1,79 @@
local M = {}
function M.reset(theme)
vim.opt.background = (theme.variant == "light") and "light" or "dark"
vim.g.colors_name = theme.name
end
local function list_integrations(theme_name)
local path = vim.fn.stdpath("config") .. "/lua/themes/" .. theme_name .. "/groups/integrations/"
local files = {}
for name, type in vim.fs.dir(path) do
if type == "file" then
local mod_name = vim.fn.fnamemodify(name, ":r")
table.insert(files, mod_name)
end
end
return files
end
function M.apply(theme)
local base = "themes." .. theme.name
local P = require(base .. ".palette").get()
local C = require(base .. ".colors").get(P)
local modules = {
require(base .. ".groups.editor"),
require(base .. ".groups.syntax"),
require(base .. ".groups.terminal"),
}
local exclude = theme.exclude_integrations or {}
local function should_load(name)
return not vim.tbl_contains(exclude, name)
end
-- auto-discover integrations
for _, plugin in ipairs(list_integrations(theme.name)) do
if should_load(plugin) then
local ok_mod, mod = pcall(require, base .. ".groups.integrations." .. plugin)
if ok_mod then
table.insert(modules, mod)
end
end
end
-- Apply highlights
for _, mod in ipairs(modules) do
local groups = mod.get(C) or {}
for group, opts in pairs(groups) do
if type(opts) ~= "table" then
print("Non-table opts detected in group:", group, "value:", vim.inspect(opts))
end
local hl = {}
-- ALT: Use both scenarios
-- if type(v) == "number" then
-- hl.ctermfg = v
-- else
-- hl.fg = v
-- end
for k, v in pairs(opts) do
if k == "fg" then
hl.ctermfg = v
elseif k == "bg" then
hl.ctermbg = v
else
hl[k] = v -- bold, italic, underline, sp, etc.
end
end
vim.api.nvim_set_hl(0, group, hl)
end
end
end
return M