feat: added colorscheme names for styles

This commit is contained in:
Folke Lemaitre
2022-09-05 16:09:28 +02:00
parent dba4e35903
commit a3b558b552
8 changed files with 15 additions and 14 deletions

View File

@@ -0,0 +1 @@
require("tokyonight").load({ style = "day" })

View File

@@ -0,0 +1 @@
require("tokyonight").load({ style = "night" })

View File

@@ -0,0 +1 @@
require("tokyonight").load({ style = "storm" })

1
colors/tokyonight.lua Normal file
View File

@@ -0,0 +1 @@
require("tokyonight").load()

View File

@@ -1,9 +0,0 @@
" clear cache so this reloads changes.
" useful for development
" lua package.loaded['tokyonight'] = nil
" lua package.loaded['tokyonight.theme'] = nil
" lua package.loaded['tokyonight.colors'] = nil
" lua package.loaded['tokyonight.util'] = nil
lua package.loaded['tokyonight.config'] = nil
lua require('tokyonight').colorscheme()

View File

@@ -1,11 +1,11 @@
local util = require("tokyonight.util") local util = require("tokyonight.util")
local config = require("tokyonight.config").options
local M = {} local M = {}
---@return ColorScheme ---@return ColorScheme
function M.setup(opts) function M.setup(opts)
opts = opts or {} opts = opts or {}
local config = require("tokyonight.config").options
-- Color Palette -- Color Palette
---@class ColorScheme ---@class ColorScheme

View File

@@ -1,6 +1,3 @@
-- shim vim for kitty and other generators
vim = vim or { g = {}, o = {} }
local M = {} local M = {}
---@class Config ---@class Config
@@ -32,6 +29,10 @@ function M.setup(options)
M.options = vim.tbl_deep_extend("force", {}, defaults, options or {}) M.options = vim.tbl_deep_extend("force", {}, defaults, options or {})
end end
function M.extend(options)
M.options = vim.tbl_deep_extend("force", {}, M.options or defaults, options or {})
end
M.setup() M.setup()
return M return M

View File

@@ -3,8 +3,13 @@ local theme = require("tokyonight.theme")
local M = {} local M = {}
function M.colorscheme() function M.load(opts)
if opts then
require("tokyonight.config").extend(opts)
end
util.load(theme.setup()) util.load(theme.setup())
end end
M.colorscheme = M.load
return M return M