-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29f305c
commit 8257341
Showing
4 changed files
with
117 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- /cvusmo/blackbeard-nvim/lua/blackbeard/dark-mode.lua | ||
|
||
local M = { | ||
bg = "#1C1B1A", | ||
fg = "#F4E3C1", | ||
cursor = "#F27835", | ||
selection_bg = "#F4A259", | ||
selection_fg = "#1C1B1A", | ||
black = "#454240", | ||
red = "#D13438", | ||
green = "#73A857", | ||
yellow = "#F1C232", | ||
blue = "#5A8CA5", | ||
magenta = "#A066C9", | ||
cyan = "#46B9A0", | ||
white = "#AA9E87", | ||
brblack = "#614A4D", | ||
brred = "#FF5F56", | ||
brgreen = "#88C070", | ||
bryellow = "#FADF60", | ||
brblue = "#73B3D8", | ||
brmagenta = "#B794F4", | ||
brcyan = "#6FE2CA", | ||
brwhite = "#F6E8CD", | ||
} | ||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- /cvusmo/blackbeard-nvim/lua/blackbeard/light-mode.lua | ||
|
||
local M = { | ||
bg = "#F4E3C1", | ||
fg = "#1C1B1A", | ||
cursor = "#F27835", | ||
selection_bg = "#F4A259", | ||
selection_fg = "#1C1B1A", | ||
black = "#454240", | ||
red = "#D13438", | ||
green = "#88C070", | ||
yellow = "#F1C232", | ||
blue = "#5A8CA5", | ||
magenta = "#A066C9", | ||
cyan = "#5A8CA5", | ||
white = "#AA9E87", | ||
brblack = "#614A4D", | ||
brred = "#FF5F56", | ||
brgreen = "#88C070", | ||
bryellow = "#FADF60", | ||
brblue = "#73B3D8", | ||
brmagenta = "#B794F4", | ||
brcyan = "#6FE2CA", | ||
brwhite = "#F6E8CD", | ||
} | ||
return M | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,62 @@ | ||
-- ~/cvusmo/blackbeard-nvim/lua/blackbeard/themes.lua | ||
-- /cvusmo/blackbeard-nvim/lua/blackbeard/init.lua | ||
|
||
local M = {} | ||
local alacritty = require("blackbeard.alacritty") | ||
|
||
-- Dark Theme | ||
M.dark = function(palette) | ||
return { | ||
Normal = { fg = palette.fg, bg = palette.bg }, | ||
Directory = { fg = palette.blue }, | ||
Function = { fg = palette.red }, | ||
Identifier = { fg = palette.yellow }, | ||
} | ||
M.config = { | ||
theme = "dark", -- Default theme | ||
} | ||
|
||
function M.setup(config) | ||
-- Merge user-provided configuration with defaults | ||
M.config = vim.tbl_deep_extend("force", M.config, config or {}) | ||
|
||
-- Load the initial theme | ||
M.load(M.config.theme) | ||
end | ||
|
||
function M.load(theme) | ||
theme = theme or M.config.theme | ||
M.config.theme = theme | ||
|
||
-- Load colors directly from dark-mode.lua or light-mode.lua | ||
local colors = require("blackbeard." .. theme .. "-mode") | ||
|
||
if not colors then | ||
vim.notify("Blackbeard: Invalid theme specified: " .. theme, vim.log.levels.ERROR) | ||
return | ||
end | ||
|
||
-- Apply Neovim highlights for the selected theme | ||
local theme_function = require("blackbeard.themes")[theme] | ||
if theme_function then | ||
local neovim_colors = theme_function(colors) | ||
M.apply_highlights(neovim_colors) | ||
|
||
-- Update Alacritty with the current theme's colors | ||
alacritty.update_theme(theme) | ||
else | ||
vim.notify("Blackbeard: Theme function not found for " .. theme, vim.log.levels.ERROR) | ||
end | ||
end | ||
|
||
-- Light Theme | ||
M.light = function(palette) | ||
return { | ||
Normal = { fg = palette.brblack, bg = palette.white }, | ||
Directory = { fg = palette.blue }, | ||
Function = { fg = palette.red }, | ||
Identifier = { fg = palette.green }, | ||
} | ||
function M.apply_highlights(theme_colors) | ||
for group, settings in pairs(theme_colors) do | ||
local highlight_cmd = "highlight " .. group | ||
if settings.fg then | ||
highlight_cmd = highlight_cmd .. " guifg=" .. settings.fg | ||
end | ||
if settings.bg then | ||
highlight_cmd = highlight_cmd .. " guibg=" .. settings.bg | ||
end | ||
if settings.italic then | ||
highlight_cmd = highlight_cmd .. " gui=italic" | ||
end | ||
if settings.bold then | ||
highlight_cmd = highlight_cmd .. " gui=bold" | ||
end | ||
vim.cmd(highlight_cmd) | ||
end | ||
end | ||
|
||
return M |