theme_name -> base_name

This commit is contained in:
Michael Chris Lopez
2021-09-21 19:27:49 +08:00
parent 0dcbcca4a4
commit 793e21d549

View File

@@ -1,6 +1,6 @@
vim.g.colors_name = "neovim" vim.g.colors_name = "neovim"
local theme_name = vim.opt.background:get() == "light" and "zenbones" or "zenflesh" local base_name = vim.opt.background:get() == "light" and "zenbones" or "zenflesh"
-- By setting our module to nil, we clear lua's cache, -- By setting our module to nil, we clear lua's cache,
-- which means the require ahead will *always* occur. -- which means the require ahead will *always* occur.
@@ -14,14 +14,14 @@ local theme_name = vim.opt.background:get() == "light" and "zenbones" or "zenfle
-- --
-- The performance impact of this call can be measured in the hundreds of -- The performance impact of this call can be measured in the hundreds of
-- *nanoseconds* and such could be considered "production safe". -- *nanoseconds* and such could be considered "production safe".
package.loaded[theme_name .. ".palette"] = nil package.loaded[base_name .. ".palette"] = nil
package.loaded[theme_name] = nil package.loaded[base_name] = nil
local lush = require "lush" local lush = require "lush"
local hsluv = lush.hsluv local hsluv = lush.hsluv
local palette = require(theme_name .. ".palette") local palette = require(base_name .. ".palette")
if theme_name == "zenbones" then if base_name == "zenbones" then
palette.bg = hsluv "#e7eee8" -- --bg-color palette.bg = hsluv "#e7eee8" -- --bg-color
palette.fg = hsluv "#202e18" -- --accent-color palette.fg = hsluv "#202e18" -- --accent-color
palette.leaf = palette.leaf.sa(24).li(8) -- Need to make green more prominent palette.leaf = palette.leaf.sa(24).li(8) -- Need to make green more prominent
@@ -31,9 +31,9 @@ else
palette.leaf = hsluv "#8fff6d" -- --accent-color palette.leaf = hsluv "#8fff6d" -- --accent-color
end end
local theme = require(theme_name) local theme = require(base_name)
local specs local specs
if theme_name == "zenbones" then if base_name == "zenbones" then
specs = lush.extends({ theme }).with(function() specs = lush.extends({ theme }).with(function()
return { return {
helpHyperTextJump { fg = hsluv "#195174" }, -- --link-color helpHyperTextJump { fg = hsluv "#195174" }, -- --link-color
@@ -52,7 +52,7 @@ else
end) end)
end end
require(theme_name .. ".terminal").setup() require(base_name .. ".terminal").setup()
-- include our theme file and pass it to lush to apply -- include our theme file and pass it to lush to apply
lush(specs) lush(specs)