From de0a71a91fbd0f0284bfdab841a278406a2eafad Mon Sep 17 00:00:00 2001 From: Michael Chris Lopez Date: Sun, 31 Oct 2021 08:29:01 +0800 Subject: [PATCH] add vimbones to build --- lua/zenbones/build.lua | 22 +++++++++++++++++++--- lua/zenbones/template/vim.lua | 4 ++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/lua/zenbones/build.lua b/lua/zenbones/build.lua index 0eafe62..d01dce1 100644 --- a/lua/zenbones/build.lua +++ b/lua/zenbones/build.lua @@ -8,12 +8,13 @@ local function write_template(path, template, values) file:close() end -local function build(name, specs, palette, options) - local exclude = options.exclude or {} +local function build(name, specs, palette, opt) + local exclude = opt.exclude or {} local templates = { "vim", "iterm", "kitty", "alacritty", "wezterm", "lualine", "lightline", "tmux" } + local template_opt = opt.template_opt or {} for _, t in ipairs(templates) do if not vim.tbl_contains(exclude, t) then - write_template(unpack(require("zenbones.template." .. t)(name, specs, palette))) + write_template(unpack(require("zenbones.template." .. t)(name, specs, palette, template_opt[t] or {}))) end end end @@ -22,6 +23,11 @@ local colorschemes = { { name = "zenbones", palette = require "zenbones.palette", + opt = { + template_opt = { + vim = { bg = "light" }, + }, + }, }, { @@ -216,6 +222,16 @@ local colorschemes = { exclude = { "vim", "alacritty", "iterm", "kitty", "tmux", "wezterm" }, }, }, + + { + name = "vimbones", + palette = require "vimbones.palette", + opt = { + template_opt = { + vim = { bg = "light" }, + }, + }, + }, } local function build_from(colorscheme) diff --git a/lua/zenbones/template/vim.lua b/lua/zenbones/template/vim.lua index 41ad7c1..d3d2986 100644 --- a/lua/zenbones/template/vim.lua +++ b/lua/zenbones/template/vim.lua @@ -40,7 +40,7 @@ endif ]] local lush = require "lush" -return function(name, specs, p) +return function(name, specs, p, opt) local term = require("zenbones.term").colors_map(p) local termcolors = "" for i, v in ipairs(term) do @@ -56,7 +56,7 @@ return function(name, specs, p) { name = name, specs_path = name, - background = name == "zenbones" and "light" or "dark", + background = opt.bg or "dark", termcolors = termcolors, vimcolors = vimcolors, },