maxmx03.solarized.nvim/lua/solarized/init.lua
Max Miliano 5b304a17ae feat: Solarized theme restructuring
The "Solarized Neo" theme, which included both light and dark variants,
has been dropped. The light variant of "Neo" is now the "Solarized
Light" theme. The original "Solarized" by Ethan Schoonover, which also
had light and dark versions, is now solely represented as the "Solarized
Dark" theme.
2024-08-23 19:46:38 -03:00

39 lines
904 B
Lua

---@class solarized
---@field config solarized.config
---@field setup fun(config: solarized.config)
---@field load fun()
local M = {}
M.config = require 'solarized.config'
M.setup = function(config)
M.config = vim.tbl_deep_extend('force', M.config, config)
end
M.load = function()
if vim.g.colors_name then
vim.cmd 'hi clear'
end
if vim.fn.exists 'syntax_on' then
vim.cmd 'syntax reset'
end
vim.g.colors_name = 'solarized'
local highlights = {}
local colors = {}
if vim.o.background == 'dark' then
highlights = require 'solarized.highlights'
local palette = require 'solarized.palette'
colors = palette[M.config.palette]
else
highlights = require 'solarized.highlights.solarized-light'
local palette = require 'solarized.palette.solarized-light'
colors = palette[M.config.palette]
end
highlights.set_highlight(colors, M.config)
end
return M