diff --git a/colors.css b/colors.css new file mode 100644 index 0000000..25408af --- /dev/null +++ b/colors.css @@ -0,0 +1,56 @@ +.light { + .green { + .fg { color: oklch(0.45 0.1 160); } + .bg { color: oklch(0.97 0.02 160); } + } + + .purple { + .fg { color: oklch(0.45 0.1 335); } + .bg { color: oklch(0.97 0.02 335); } + } + + .yellow { + .fg { color: oklch(0.45 0.1 100); } + .bg { color: oklch(0.97 0.02 100); } + } + + .blue { + .fg { color: oklch(0.45 0.1 210); } + .bg { color: oklch(0.97 0.02 210); } + } +} + +.green { + .light { color: oklch(0.8 0.08 150); } + .regular { color: oklch(0.8 0.18 150); } + .dark { color: oklch(0.33 0.06 150); } + .darker { color: oklch(0.2 0.03 150); } +} + +.purple { + .light { color: oklch(0.8 0.08 330); } + .regular { color: oklch(0.8 0.18 330); } + .dark { color: oklch(0.33 0.06 330); } + .darker { color: oklch(0.2 0.03 330); } +} + +.yellow { + .light { color: oklch(0.8 0.08 90); } + .regular { color: oklch(0.8 0.18 90); } + .dark { color: oklch(0.33 0.06 90); } + .darker { color: oklch(0.2 0.03 90); } +} + +.blue { + .light { color: oklch(0.8 0.08 210); } + .regular { color: oklch(0.8 0.18 210); } + .dark { color: oklch(0.33 0.06 210); } + .darker { color: oklch(0.2 0.03 210); } +} + +.red { + .light { color: oklch(0.8 0.08 25); } + .regular { color: oklch(0.65 0.25 25); } + .dark { color: oklch(0.33 0.06 25); } + .darker { color: oklch(0.2 0.03 25); } +} diff --git a/lua/mycolortheme/init.lua b/lua/mycolortheme/init.lua index 807a336..09a7783 100644 --- a/lua/mycolortheme/init.lua +++ b/lua/mycolortheme/init.lua @@ -1,25 +1,76 @@ local M = {} -function M.setup() +function M.setup(config) vim.cmd("highlight clear") vim.cmd("syntax reset") - vim.o.background = "dark" + vim.o.background = config.style vim.g.colors_name = "my color theme" local colors = { - bg = "#000000", - fg = "#ffffff", - green = { fg = "#3ad070", bg = nil } + 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" + }, } - local highlights = { - Normal = { fg = colors.fg, bg = colors.bg }, - Constant = { fg = colors.green.fg, bg = colors.green.bg } - } + for _, highlight in ipairs({ "editor", "syntax", "treesitter" }) do + local mod = require("mycolortheme.highlights." .. highlight) - for group, opts in pairs(highlights) do - vim.api.nvim_set_hl(0, group, opts) + for group, opts in pairs(mod.setup(colors, config)) do + vim.api.nvim_set_hl(0, group, opts) + end + end + + for _, highlight in ipairs({ "ruby" }) do + local mod = require("mycolortheme.highlights.languages." .. highlight) + + for group, opts in pairs(mod.setup(colors, config)) do + vim.api.nvim_set_hl(0, group, opts) + end + end + + for _, highlight in ipairs({ "netrw", "fzf", "blink", "mini" }) do + local mod = require("mycolortheme.highlights.plugins." .. highlight) + + for group, opts in pairs(mod.setup(colors, config)) do + vim.api.nvim_set_hl(0, group, opts) + end end end