fix: bugs at init

dev-assets
Pocco81 3 years ago
parent 9ac9710650
commit df70644d9d

@ -1,17 +1,8 @@
local util = require("catppuccino.utils.util")
local opts = require("catppuccino.config").options
local M = {}
function M.setup(config)
config = config or require("nightfox.config")
-- References:
-- https://coolors.co/e63946-f1faee-a8dadc-457b9d-1d3557
-- https://coolors.co/f4f1de-e07a5f-3d405b-81b29a-f2cc8f
-- https://coolors.co/264653-2a9d8f-e9c46a-f4a261-e76f51
-- stylua: ignore
local colors = {
local colors = {
none = "NONE",
bg = "#0e171c",
fg = "#CDCECF",
@ -48,57 +39,54 @@ function M.setup(config)
change = "#394b70",
delete = "#823c41"
}
}
}
util.bg = colors.bg
util.bg = colors.bg
colors.bg_alt = util.darken(colors.bg, 0.75, "#000000")
colors.bg_highlight = util.brighten(colors.bg, 0.10)
colors.bg_alt = util.darken(colors.bg, 0.75, "#000000")
colors.bg_highlight = util.brighten(colors.bg, 0.10)
colors.fg_alt = util.darken(colors.fg, 0.80, "#000000")
colors.fg_alt = util.darken(colors.fg, 0.80, "#000000")
colors.diff = {
colors.diff = {
add = util.darken(colors.green, 0.15),
delete = util.darken(colors.red, 0.15),
change = util.darken(colors.blue, 0.15),
text = colors.blue
}
}
colors.gitSigns = {
colors.gitSigns = {
add = util.brighten(colors.gitSigns.add, 0.2),
change = util.brighten(colors.gitSigns.change, 0.2),
delete = util.brighten(colors.gitSigns.delete, 0.2)
}
colors.git.ignore = colors.black
colors.black = util.darken(colors.bg, 0.8, "#000000")
colors.border_highlight = colors.blue
colors.border = colors.black
}
-- Popups and statusline always get a dark background
colors.bg_popup = colors.bg_alt
colors.bg_statusline = colors.bg_alt
colors.git.ignore = colors.black
colors.black = util.darken(colors.bg, 0.8, "#000000")
colors.border_highlight = colors.blue
colors.border = colors.black
-- Sidebar and Floats are configurable
-- colors.bg_sidebar = config.darkSidebar and colors.bg_alt or colors.bg
-- colors.bg_float = config.darkFloat and colors.bg_alt or colors.bg
colors.bg_sidebar = colors.bg_alt
colors.bg_float = colors.bg_alt
-- Popups and statusline always get a dark background
colors.bg_popup = colors.bg_alt
colors.bg_statusline = colors.bg_alt
colors.bg_visual = util.darken(colors.blue, 0.2)
colors.bg_search = util.darken(colors.cyan, 0.3)
colors.fg_sidebar = colors.fg_alt
-- Sidebar and Floats are configurable
-- colors.bg_sidebar = config.darkSidebar and colors.bg_alt or colors.bg
-- colors.bg_float = config.darkFloat and colors.bg_alt or colors.bg
colors.bg_sidebar = colors.bg_alt
colors.bg_float = colors.bg_alt
colors.error = colors.red
colors.warning = colors.yellow
colors.info = colors.blue
colors.hint = colors.cyan
colors.bg_visual = util.darken(colors.blue, 0.2)
colors.bg_search = util.darken(colors.cyan, 0.3)
colors.fg_sidebar = colors.fg_alt
colors.variable = colors.white
colors.error = colors.red
colors.warning = colors.yellow
colors.info = colors.blue
colors.hint = colors.cyan
util.color_overrides(colors, config)
colors.variable = colors.white
return colors
end
util.color_overrides(colors, opts)
return M
return colors

@ -1,4 +1,5 @@
local hsluv = require("catppuccino.utils.hsluv")
local opts = require("catppuccino.config").options
local g = vim.g
local o = vim.o
@ -9,6 +10,7 @@ util.bg = "#000000"
util.fg = "#ffffff"
util.day_brightness = 0.3
---@param hex_str string hexadecimal value of a color
local hex_to_rgb = function(hex_str)
local hex = "[abcdef0-9][abcdef0-9]"
local pat = "^#(" .. hex .. ")(" .. hex .. ")(" .. hex .. ")$"
@ -169,9 +171,9 @@ function util.load(theme)
util.syntax(theme.base)
util.syntax(theme.plugins)
if theme.config.terminal_colors then
util.terminal(theme)
end
-- if opts.ui.terminal then
-- util.terminal(theme)
-- end
end
return util

Loading…
Cancel
Save