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

View File

@@ -0,0 +1,80 @@
local M = {}
function M.setup(colors, config)
local accent = colors[config.accent]
return {
Normal = { fg = colors.fg, bg = colors.bg },
NonText = { fg = colors.dimmed },
Conceal = { fg = colors.dimmed },
Cursor = { bg = accent.regular, fg = colors.inverted },
CursorLine = { bg = accent.darker },
CursorColumn = { bg = accent.darker },
ColorColumn = { bg = accent.dark },
Visual = { bg = accent.dark },
VisualNOS = { bg = accent.darker },
Directory = { fg = accent.regular },
SpecialKey = { fg = colors.dimmed },
EndOfBuffer = { fg = colors.dimmed },
DiffAdd = { bg = colors.green.dark, fg = colors.green.regular },
DiffDelete = { bg = colors.red.dark, fg = colors.red.regular },
DiffText = { bg = colors.yellow.regular, fg = colors.yellow.darker },
DiffChange = { bg = colors.yellow.dark, fg = colors.yellow.regular },
Search = { bg = accent.dark, fg = accent.regular },
IncSearch = { bg = accent.regular, fg = accent.darker },
MatchParen = { fg = accent.regular },
LineNr = { fg = colors.dimmed },
CursorLineNr = { fg = accent.regular },
SignColumn = {},
Folded = { fg = accent.light },
FoldColumn = { fg = accent.light },
WinBar = { bg = accent.dark, fg = accent.regular },
WinBarNC = { bg = accent.darker, fg = accent.regular },
WinSeparator = { fg = accent.light },
VertSplit = { fg = accent.light },
Pmenu = { fg = colors.fg },
PmenuExtra = { fg = colors.dimmed },
PmenuSel = { bg = accent.dark },
PmenuSbar = { bg = accent.regular },
PmenuThumb = { bg = accent.regular },
PmenuKind = { fg = accent.regular },
NormalFloat = {},
FloatBorder = { fg = accent.regular },
WildMenu = { bg = accent.dark },
ErrorMsg = { fg = colors.red.regular, bg = colors.red.dark },
WarningMsg = { bg = colors.yellow.dark, fg = colors.yellow.regular },
MoreMsg = { fg = colors.green.regular },
Question = { fg = colors.blue.regular },
StatusLine = { bg = accent.dark, fg = accent.regular },
StatusLineNC = { bg = accent.darker, fg = accent.regular },
TabLine = { bg = accent.dark, fg = accent.regular },
TabLineFill = { bg = accent.dark },
TabLineSel = { bg = accent.darker, fg = accent.regular },
SpellBad = { undercurl = true, sp = colors.red.light },
SpellCap = { undercurl = true, sp = colors.blue.light },
SpellLocal = { undercurl = true, sp = colors.green.light },
SpellRare = { undercurl = true, sp = colors.purple.light },
Title = { fg = accent.regular },
TermCursor = { bg = accent.regular, fg = colors.inverted },
TermCursorNC = { bg = accent.darker, fg = colors.dimmed },
QuickFixLine = { bg = accent.dark },
}
end
return M

View File

@@ -0,0 +1,9 @@
local M = {}
function M.setup(colors, config)
return {
["@string.special.symbol.ruby"] = { fg = colors.green.regular },
}
end
return M

View File

@@ -0,0 +1,35 @@
local M = {}
function M.setup(colors, config)
local accent = colors[config.accent]
return {
BlinkCmpMenu = {},
BlinkCmpMenuBorder = { fg = accent.regular },
BlinkCmpMenuSelection = { bg = accent.dark },
BlinkCmpScrollBarThumb = { bg = accent.regular },
BlinkCmpScrollBarGutter = { bg = accent.darker },
BlinkCmpLabel = { fg = colors.fg },
BlinkCmpLabelDeprecated = { fg = colors.dimmed, strikethrough = true },
BlinkCmpLabelMatch = { fg = accent.regular, bold = true },
BlinkCmpLabelDetail = { fg = colors.dimmed },
BlinkCmpLabelDescription = { fg = colors.dimmed },
BlinkCmpKind = { fg = accent.regular },
BlinkCmpSource = { fg = colors.dimmed },
BlinkCmpGhostText = { fg = colors.dimmed, italic = true },
BlinkCmpDoc = { fg = colors.fg },
BlinkCmpDocBorder = { fg = accent.regular },
BlinkCmpDocSeparator = { fg = accent.light },
BlinkCmpDocCursorLine = { bg = accent.dark },
BlinkCmpSignatureHelp = { fg = colors.fg },
BlinkCmpSignatureHelpBorder = { fg = accent.regular },
BlinkCmpSignatureHelpActiveParameter = { fg = accent.regular, bold = true },
}
end
return M

View File

@@ -0,0 +1,13 @@
local M = {}
function M.setup(colors, config)
local accent = colors[config.accent]
return {
FzfLuaNormal = { fg = colors.fg, bg = nil },
FzfLuaBorder = { fg = accent.regular, bg = nil },
FzfLuaTitle = { fg = accent.regular, bold = false },
}
end
return M

View File

@@ -0,0 +1,33 @@
local M = {}
function M.setup(colors, config)
local accent = colors[config.accent]
return {
MiniClueBorder = { fg = accent.regular },
MiniClueDescGroup = { fg = accent.regular },
MiniClueDescSingle = { fg = colors.fg },
MiniClueNextKey = { fg = accent.light },
MiniClueNextKeyWithPostkeys = { fg = accent.light, bold = true }, -- TODO Verify use case
MiniClueSeparator = { fg = accent.light },
MiniClueTitle = { fg = accent.regular },
MiniDiffSignAdd = { fg = colors.green.light },
MiniDiffSignChange = { fg = colors.blue.light },
MiniDiffSignDelete = { fg = colors.red.light },
MiniHipatternsFixme = { bg = colors.red.dark, fg = colors.red.regular },
MiniHipatternsHack = { bg = colors.purple.dark, fg = colors.purple.regular },
MiniHipatternsTodo = { bg = colors.blue.dark, fg = colors.blue.regular },
MiniHipatternsNote = { bg = colors.yellow.dark, fg = colors.yellow.regular },
MiniNotifyBorder = { fg = accent.regular },
MiniNotifyLspProgress = { fg = accent.regular },
MiniNotifyNormal = { fg = colors.fg },
MiniNotifyTitle = { fg = accent.regular },
-- TODO Add groups for status line
}
end
return M

View File

@@ -0,0 +1,20 @@
local M = {}
function M.setup(colors, config)
local accent = colors[config.accent]
return {
NetrwDir = { fg = accent.regular },
NetrwClassify = { fg = accent.light },
NetrwExe = { fg = colors.green.regular },
NetrwSymLink = { fg = colors.blue.light },
NetrwTreeBar = { fg = accent.dark },
NetrwPlain = { fg = colors.fg },
NetrwMarkFile = { bg = accent.dark, fg = accent.regular },
NetrwQuickHelp = { fg = colors.dimmed },
NetrwVersion = { fg = colors.dimmed },
NetrwCopyFile = { fg = colors.blue.regular },
}
end
return M

View File

@@ -0,0 +1,43 @@
local M = {}
function M.setup(colors, config)
return {
Comment = { fg = colors.yellow.regular, italic = true },
Constant = { fg = colors.purple.regular },
Boolean = { link = "Constant" },
String = { fg = colors.green.regular },
Character = { link = "String" },
Number = { link = "Constant" },
Float = { link = "Number" },
Operator = { fg = colors.dimmed },
Identifier = { link = "Normal" },
Function = { fg = colors.blue.regular },
Statement = { link = "Normal" },
Conditional = { link = "Statement" },
Repeat = { link = "Statement" },
Label = { link = "Statement" },
Keyword = { link = "Statement" },
Exception = { link = "Statement" },
PreProc = { link = "Statement" },
Include = { link = "Statement" },
Define = { link = "Statement" },
Macro = { link = "Statement" },
PreCondit = { link = "Statement" },
Type = { link = "Statement" },
StorageClass = { link = "Statement" },
Structure = { link = "Statement" },
Typedef = { link = "Statement" },
Delimiter = { fg = colors.dimmed },
Special = { fg = colors.dimmed },
SpecialComment = { link = "Special" },
Underlined = { underline = true },
Italic = { italic = true },
}
end
return M

View File

@@ -0,0 +1,73 @@
local M = {}
function M.setup(colors, config)
return {
["@comment"] = { fg = colors.yellow.regular },
["@constant"] = { fg = colors.purple.regular },
["@constant.builtin"] = { link = "@constant" },
["@string"] = { fg = colors.green.regular },
["@string.regex"] = { link = "@string" }, -- TODO: Differentiate regex
["@string.escape"] = { link = "@string" },
["@number"] = { link = "@constant" },
["@boolean"] = { link = "@constant" },
["@operator"] = { fg = colors.dimmed },
["@function"] = { fg = colors.blue.regular },
["@function.call"] = { fg = colors.fg },
["@function.method.call"] = { link = "@function.call" },
["@function.builtin"] = { link = "@function" },
["@function.macro"] = { link = "@function" },
["@method"] = { link = "@function.call" },
["@method.call"] = { link = "@method" },
["@keyword"] = { fg = colors.fg },
["@keyword.function"] = { link = "@keyword" },
["@keyword.operator"] = { link = "@keyword" },
["@keyword.return"] = { link = "@keyword" },
["@punctuation"] = { fg = colors.dimmed },
["@punctuation.delimiter"] = { link = "@punctuation" },
["@punctuation.bracket"] = { link = "@punctuation" },
["@punctuation.special"] = { link = "@punctuation" },
["@variable"] = { fg = colors.fg },
["@variable.builtin"] = { link = "@variable" },
["@variable.parameter"] = { link = "@variable" },
["@variable.member"] = { link = "@variable" },
["@type"] = { fg = colors.fg },
["@type.builtin"] = { link = "@type" },
["@type.definition"] = { link = "@type" },
["@type.qualifier"] = { link = "@type" },
["@tag"] = { fg = colors.yellow.regular },
["@tag.attribute"] = { fg = colors.fg },
["@tag.delimiter"] = { link = "@punctuation" },
["@symbol"] = { fg = colors.blue.regular },
["@string.special"] = { fg = colors.dimmed },
-- ["@attribute"] = { link = "Normal" },
-- ["@constructor"] = { link = "Normal" },
-- ["@conditional"] = { link = "Normal" },
-- ["@error"] = { link = "Normal" }, -- TODO: Add proper error color
-- ["@exception"] = { link = "Normal" },
-- ["@field"] = { link = "Normal" },
-- ["@label"] = { link = "Normal" },
-- ["@module"] = { link = "Normal" },
-- ["@namespace"] = { link = "Normal" },
-- -- ["@none"] = { fg = colors.purple.regular },
-- ["@parameter"] = { link = "Normal" },
-- ["@parameter.reference"] = { link = "Normal" },
-- ["@property"] = { link = "Normal" },
-- ["@repeat"] = { link = "Normal" },
-- ["@symbol"] = { link = "String" },
-- ["@text"] = { link = "Normal" },
-- ["@text.note"] = { fg = colors.blue.regular },
-- ["@text.warning"] = { link = "Normal" }, -- TODO: Add proper error color
}
end
return M

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