feat: add randombones variants for when light / dark themes are set (#219)
* adding random options specific to set backgrounds skeleton checking about name checking approach setting to dark light parity * changed so colorscheme = randombones and randombones_colors_name = randomly chosen theme * let colorscheme have _dark / _light prefix
This commit is contained in:
committed by
GitHub
parent
510819be60
commit
e3ab355fe9
24
colors/randombones_dark.lua
Normal file
24
colors/randombones_dark.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
if vim.g.colors_name then
|
||||
vim.api.nvim_command [[highlight clear]]
|
||||
end
|
||||
|
||||
vim.g.colors_name = "randombones_dark"
|
||||
|
||||
local util = require "zenbones.util"
|
||||
local colorschemes = util.get_colorscheme_list()
|
||||
|
||||
math.randomseed(os.time())
|
||||
|
||||
local colorscheme = colorschemes[1]
|
||||
while true do
|
||||
local index = math.random(#colorschemes)
|
||||
colorscheme = colorschemes[index]
|
||||
if colorscheme.background ~= "light" then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
vim.g.randombones_colors_name = colorscheme.name
|
||||
vim.o.background = "dark"
|
||||
|
||||
util.apply_colorscheme()
|
||||
24
colors/randombones_light.lua
Normal file
24
colors/randombones_light.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
if vim.g.colors_name then
|
||||
vim.api.nvim_command [[highlight clear]]
|
||||
end
|
||||
|
||||
vim.g.colors_name = "randombones_light"
|
||||
|
||||
local util = require "zenbones.util"
|
||||
local colorschemes = util.get_colorscheme_list()
|
||||
|
||||
math.randomseed(os.time())
|
||||
|
||||
local colorscheme = colorschemes[1]
|
||||
while true do
|
||||
local index = math.random(#colorschemes)
|
||||
colorscheme = colorschemes[index]
|
||||
if colorscheme.background ~= "dark" then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
vim.g.randombones_colors_name = colorscheme.name
|
||||
vim.o.background = "light"
|
||||
|
||||
util.apply_colorscheme()
|
||||
Reference in New Issue
Block a user