Rename colorscheme to Voltage

This commit is contained in:
Tommaso Negri
2025-12-05 18:22:32 +01:00
parent f9e2bdfd82
commit 722a868549
12 changed files with 20 additions and 14 deletions

83
lua/voltage/init.lua Normal file
View File

@@ -0,0 +1,83 @@
local M = {}
M.config = {
accent = "blue"
}
function M.setup(opts)
M.config = vim.tbl_deep_extend("force", M.config, opts or {})
vim.cmd("highlight clear")
vim.cmd("syntax reset")
vim.o.background = "dark"
vim.g.colors_name = "voltage"
local colors = {
bg = nil,
fg = "#f0f0f0",
dimmed = "#707070",
inverted = "#000000",
-- strings, numbers, etc
green = {
light = "#99cda3",
regular = "#54dd7d",
dark = "#1c3e24",
darker = "#0c1a0f"
},
-- constants
purple = {
light = "#dcabd6",
regular = "#fd8ff4",
dark = "#472944",
darker = "#1e111c"
},
-- comments
yellow = {
light = "#d2bc82",
regular = "#ebb600",
dark = "#41340a",
darker = "#1b1505"
},
-- top-level definitions
blue = {
light = "#7dccda",
regular = "#00d8f5",
dark = "#003d46",
darker = "#031a1e"
},
-- errors, spellbad, etc
red = {
light = "#edaaa4",
regular = "#ff2335",
dark = "#502825",
darker = "#22100f"
},
}
for _, highlight in ipairs({ "editor", "syntax", "treesitter" }) do
local mod = require("voltage.highlights." .. highlight)
for group, group_opts in pairs(mod.setup(colors, M.config)) do
vim.api.nvim_set_hl(0, group, group_opts)
end
end
for _, highlight in ipairs({ "ruby" }) do
local mod = require("voltage.highlights.languages." .. highlight)
for group, group_opts in pairs(mod.setup(colors, M.config)) do
vim.api.nvim_set_hl(0, group, group_opts)
end
end
for _, highlight in ipairs({ "netrw", "fzf", "blink", "mini" }) do
local mod = require("voltage.highlights.plugins." .. highlight)
for group, group_opts in pairs(mod.setup(colors, M.config)) do
vim.api.nvim_set_hl(0, group, group_opts)
end
end
end
return M