97 lines
2.4 KiB
Lua
97 lines
2.4 KiB
Lua
local util = require("tokyonight.util")
|
|
|
|
local M = {}
|
|
|
|
---@return ColorScheme
|
|
function M.setup(opts)
|
|
opts = opts or {}
|
|
local config = require("tokyonight.config").options
|
|
|
|
-- Color Palette
|
|
---@class ColorScheme
|
|
local colors = {
|
|
none = "NONE",
|
|
bg_dark = "#1f2335",
|
|
bg = "#24283b",
|
|
bg_highlight = "#292e42",
|
|
terminal_black = "#414868",
|
|
fg = "#c0caf5",
|
|
fg_dark = "#a9b1d6",
|
|
fg_gutter = "#3b4261",
|
|
dark3 = "#545c7e",
|
|
comment = "#565f89",
|
|
dark5 = "#737aa2",
|
|
blue0 = "#3d59a1",
|
|
blue = "#7aa2f7",
|
|
cyan = "#7dcfff",
|
|
blue1 = "#2ac3de",
|
|
blue2 = "#0db9d7",
|
|
blue5 = "#89ddff",
|
|
blue6 = "#B4F9F8",
|
|
blue7 = "#394b70",
|
|
magenta = "#bb9af7",
|
|
magenta2 = "#ff007c",
|
|
purple = "#9d7cd8",
|
|
orange = "#ff9e64",
|
|
yellow = "#e0af68",
|
|
green = "#9ece6a",
|
|
green1 = "#73daca",
|
|
green2 = "#41a6b5",
|
|
teal = "#1abc9c",
|
|
red = "#f7768e",
|
|
red1 = "#db4b4b",
|
|
git = { change = "#6183bb", add = "#449dab", delete = "#914c54" },
|
|
}
|
|
if config.style == "night" or config.style == "day" or vim.o.background == "light" then
|
|
colors.bg = "#1a1b26"
|
|
colors.bg_dark = "#16161e"
|
|
end
|
|
util.bg = colors.bg
|
|
util.day_brightness = config.dayBrightness
|
|
|
|
colors.diff = {
|
|
add = util.darken(colors.green2, 0.15),
|
|
delete = util.darken(colors.red1, 0.15),
|
|
change = util.darken(colors.blue7, 0.15),
|
|
text = colors.blue7,
|
|
}
|
|
|
|
colors.gitSigns = {
|
|
add = "#266d6a",
|
|
change = "#536c9e",
|
|
delete = "#b2555b",
|
|
}
|
|
|
|
colors.git.ignore = colors.dark3
|
|
colors.black = util.darken(colors.bg, 0.8, "#000000")
|
|
colors.border_highlight = colors.blue0
|
|
colors.border = colors.black
|
|
|
|
-- Popups and statusline always get a dark background
|
|
colors.bg_popup = colors.bg_dark
|
|
colors.bg_statusline = colors.bg_dark
|
|
|
|
-- Sidebar and Floats are configurable
|
|
colors.bg_sidebar = (config.transparentSidebar and colors.none) or config.darkSidebar and colors.bg_dark or colors.bg
|
|
colors.bg_float = config.darkFloat and colors.bg_dark or colors.bg
|
|
|
|
colors.bg_visual = util.darken(colors.blue0, 0.7)
|
|
colors.bg_search = colors.blue0
|
|
colors.fg_sidebar = colors.fg_dark
|
|
|
|
colors.error = colors.red1
|
|
colors.warning = colors.yellow
|
|
colors.info = colors.blue2
|
|
colors.hint = colors.teal
|
|
|
|
util.color_overrides(colors, config)
|
|
|
|
if opts.transform and (config.style == "day" or vim.o.background == "light") then
|
|
util.invert_colors(colors)
|
|
end
|
|
|
|
return colors
|
|
end
|
|
|
|
return M
|