Skip to content

Commit

Permalink
breaking: require base_bg in util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchrish committed Nov 12, 2021
1 parent 683f76d commit 7f9f04e
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions lua/duckbones/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local hsluv = lush.hsluv

local M = {}

M.dark = util.palette_extend {
M.dark = util.palette_extend({
bg = hsluv "#0f111b",
fg = hsluv "#ecf0c1",
rose = hsluv "#e33400",
Expand All @@ -14,6 +14,6 @@ M.dark = util.palette_extend {
blossom = hsluv "#7a5ccc",
blossom1 = hsluv "#b3a1e6",
sky = hsluv "#00a3cc",
}
}, "dark")

return M
4 changes: 2 additions & 2 deletions lua/forestbones/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ M.light = util.palette_extend({
sky = hsluv(151.6, 87.3, 61.5),
}, "light")

M.dark = util.palette_extend {
M.dark = util.palette_extend({
bg = hsluv(232.6, 27, 20.7),
fg = hsluv(67.1, 26.4, 88), -- base: 67.1, 26.4, 80.3
rose = hsluv(11.3, 67.5, 64.4),
Expand All @@ -24,6 +24,6 @@ M.dark = util.palette_extend {
water = hsluv(179.5, 51, 71.8),
blossom = hsluv(339.1, 46.7, 69.8),
sky = hsluv(136.1, 45.8, 72.6),
}
}, "dark")

return M
4 changes: 2 additions & 2 deletions lua/neobones/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ M.light = util.palette_extend({
}, "light")
M.light.leaf = M.light.leaf.sa(24).li(8) -- need to make green more prominent

M.dark = util.palette_extend {
M.dark = util.palette_extend({
bg = hsluv "#0f191f", -- --bg-color
fg = hsluv "#c7d6d0", -- --fg-color
leaf = hsluv "#8fff6d", -- --accent-color
water = hsluv "#8190d4", -- default blue looks to close to bg
}
}, "dark")

return M
4 changes: 2 additions & 2 deletions lua/nordbones/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local base = {
nord15 = hsluv "#b48ead",
}

M.dark = util.palette_extend {
M.dark = util.palette_extend({
bg = base.nord0,
fg = base.nord6,
rose = base.nord11,
Expand All @@ -32,7 +32,7 @@ M.dark = util.palette_extend {
water = base.nord7,
blossom = base.nord15,
sky = base.nord8,
}
}, "dark")

M.base = base

Expand Down
4 changes: 2 additions & 2 deletions lua/rosebones/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ M.light = util.palette_extend({
text = hsluv(270.1, 22.9, 36.8), -- text, base: 270.1, 22.9, 36.8
}, "light")

M.dark = util.palette_extend {
M.dark = util.palette_extend({
bg = hsluv(271.2, 20.2, 8.5), -- base
bg_warm = hsluv(268.9, 24.5, 13.9), -- base moon
fg = hsluv(14.8, 23, 86), -- rose, base: 14.8, 59.9, 80.3
Expand All @@ -27,6 +27,6 @@ M.dark = util.palette_extend {
blossom = hsluv(283.1, 67.3, 73), -- iris
sky = hsluv(206.7, 42.9, 80), -- foam
text = hsluv(269.4, 56, 89.2), -- text, base: 269.4, 63.6, 89.2
}
}, "dark")

return M
4 changes: 2 additions & 2 deletions lua/tokyobones/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ M.light = util.palette_extend({
sky1 = hsluv "#33635c",
}, "light")

M.dark = util.palette_extend {
M.dark = util.palette_extend({
bg = hsluv "#1a1b26",
bg_warm = hsluv "#24283b", -- storm
fg = hsluv "#c0caf5",
Expand All @@ -29,6 +29,6 @@ M.dark = util.palette_extend {
sky = hsluv "#2ac3de",
orange = hsluv "#ff9e64",
sky1 = hsluv "#73daca",
}
}, "dark")

return M
2 changes: 1 addition & 1 deletion lua/zenbones/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ local util = require "zenbones.util"
local M = {}

M.light = util.palette_extend({}, "light")
M.dark = util.palette_extend {}
M.dark = util.palette_extend({}, "dark")

return M
6 changes: 4 additions & 2 deletions lua/zenbones/specs/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local M = {}

--- Get global configuration as a table.
---@param prefix string e.g. "zenbones"
---@param base_bg? string light or dark
---@param base_bg string light or dark
function M.get_global_config(prefix, base_bg)
if type(vim.g[prefix]) == "table" then
return vim.g[prefix]
Expand Down Expand Up @@ -44,7 +44,7 @@ function M.get_global_config(prefix, base_bg)
}),
common
)
else
elseif base_bg == "dark" then
return vim.tbl_extend(
"keep",
concat_config(prefix, {
Expand All @@ -57,6 +57,8 @@ function M.get_global_config(prefix, base_bg)
}),
common
)
else
error(string.format([[Invalid base_bg value: '%s', must be 'light' or 'dark'.]], base_bg))
end
end

Expand Down
6 changes: 4 additions & 2 deletions lua/zenbones/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

--- Auto-fill a palette with the default palette.
---@param p table palette
---@param base_bg? string light or dark
---@param base_bg string light or dark
---@return table<string, table> palette
function M.palette_extend(p, base_bg)
local lush = require "lush"
Expand Down Expand Up @@ -40,7 +40,7 @@ function M.palette_extend(p, base_bg)
sky1 = p.sky.sa(20).da(16),
fg1 = p.fg.li(22),
})
else
elseif base_bg == "dark" then
-- default
p = vim.tbl_extend("keep", p, {
bg = hsluv(39, 12, 9), -- sand
Expand All @@ -65,6 +65,8 @@ function M.palette_extend(p, base_bg)
sky1 = p.sky.sa(20).li(16),
fg1 = p.fg.da(22),
})
else
error(string.format([[Invalid base_bg value: '%s', must be 'light' or 'dark'.]], base_bg))
end
end

Expand Down
4 changes: 2 additions & 2 deletions lua/zenburned/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ local hsluv = lush.hsluv

local M = {}

M.dark = util.palette_extend {
M.dark = util.palette_extend({
bg = hsluv "#3f3f3f",
fg = hsluv("#efdcbc").de(14).li(20),
rose = hsluv "#e37170",
}
}, "dark")

return M
4 changes: 2 additions & 2 deletions lua/zenwritten/palette.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ M.light = util.palette_extend({
fg = hsluv(0, 0, 22), -- stone
}, "light")

M.dark = util.palette_extend {
M.dark = util.palette_extend({
bg = hsluv(0, 0, 9), -- sand
fg = hsluv(0, 0, 76), -- stone
}
}, "dark")

return M

0 comments on commit 7f9f04e

Please sign in to comment.