* 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
25 lines
517 B
Lua
25 lines
517 B
Lua
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()
|