add colorscheme dark mode
This commit is contained in:
parent
75b8b88a04
commit
b52a6d4065
4 changed files with 220 additions and 119 deletions
|
|
@ -3,13 +3,17 @@
|
|||
|
||||
local M = {}
|
||||
|
||||
-- Import color palette
|
||||
local colors = require('paper-tonic-modern.colors')
|
||||
|
||||
-- ============================================================================
|
||||
-- Helper Functions
|
||||
-- ============================================================================
|
||||
|
||||
-- Get fresh color palette (reload to respect background changes)
|
||||
local function get_colors()
|
||||
-- Clear cached module to force reload
|
||||
package.loaded['paper-tonic-modern.colors'] = nil
|
||||
return require('paper-tonic-modern.colors')
|
||||
end
|
||||
|
||||
-- Convert color table {hex, 256, ansi} to usable formats
|
||||
local function get_color(color_def, mode)
|
||||
if type(color_def) == 'string' then
|
||||
|
|
@ -92,6 +96,17 @@ end
|
|||
-- ============================================================================
|
||||
|
||||
function M.load()
|
||||
-- Get fresh colors for current background mode
|
||||
local colors = get_colors()
|
||||
|
||||
-- Clear all cached group modules to force reload with new colors
|
||||
package.loaded['paper-tonic-modern.groups.editor'] = nil
|
||||
package.loaded['paper-tonic-modern.groups.syntax'] = nil
|
||||
package.loaded['paper-tonic-modern.groups.treesitter'] = nil
|
||||
package.loaded['paper-tonic-modern.groups.semantic'] = nil
|
||||
package.loaded['paper-tonic-modern.groups.lsp'] = nil
|
||||
package.loaded['paper-tonic-modern.groups.plugins'] = nil
|
||||
|
||||
-- Load highlight groups in order
|
||||
-- Each module returns a table of { group_name = spec }
|
||||
|
||||
|
|
@ -118,9 +133,8 @@ function M.load()
|
|||
-- Plugin highlights (Telescope, Gitsigns, cmp, etc.)
|
||||
local plugins = require('paper-tonic-modern.groups.plugins')
|
||||
M.highlight_all(plugins)
|
||||
|
||||
-- Export colors for external use
|
||||
M.colors = colors
|
||||
end
|
||||
|
||||
-- Export colors for use in other modules
|
||||
M.colors = colors
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue