mirror of
https://github.com/maxmx03/solarized.nvim.git
synced 2026-09-10 07:26:26 -04:00
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.
39 lines
904 B
Lua
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
|