feat: day style for terminal apps

This commit is contained in:
Folke Lemaitre 2021-05-02 10:43:18 +02:00
parent 7dce3b82dc
commit 7dc6445349
10 changed files with 133 additions and 1 deletions

View File

@ -0,0 +1,34 @@
# TokyoNight Alacritty Colors
colors:
# Default colors
primary:
background: '0xe1e2e7'
foreground: '0x3760bf'
# Normal colors
normal:
black: '0xe9e9ed'
red: '0xf52a65'
green: '0x587539'
yellow: '0x8c6c3e'
blue: '0x2e7de9'
magenta: '0x9854f1'
cyan: '0x007197'
white: '0x6172b0'
# Bright colors
bright:
black: '0xa1a6c5'
red: '0xf52a65'
green: '0x587539'
yellow: '0x8c6c3e'
blue: '0x2e7de9'
magenta: '0x9854f1'
cyan: '0x007197'
white: '0x3760bf'
indexed_colors:
- { index: 16, color: '0xb15c00' }
- { index: 17, color: '0xc64343' }

View File

@ -0,0 +1,35 @@
# TokyoNight Color Palette
set -l foreground 3760bf
set -l selection 99a7df
set -l comment 848cb5
set -l red f52a65
set -l orange b15c00
set -l yellow 8c6c3e
set -l green 587539
set -l purple 7847bd
set -l cyan 007197
set -l pink 9854f1
# Syntax Highlighting Colors
set -g fish_color_normal $foreground
set -g fish_color_command $cyan
set -g fish_color_keyword $pink
set -g fish_color_quote $yellow
set -g fish_color_redirection $foreground
set -g fish_color_end $orange
set -g fish_color_error $red
set -g fish_color_param $purple
set -g fish_color_comment $comment
set -g fish_color_selection --background=$selection
set -g fish_color_search_match --background=$selection
set -g fish_color_operator $green
set -g fish_color_escape $pink
set -g fish_color_autosuggestion $comment
# Completion Pager Colors
set -g fish_pager_color_progress $comment
set -g fish_pager_color_prefix $cyan
set -g fish_pager_color_completion $foreground
set -g fish_pager_color_description $comment

View File

@ -0,0 +1,40 @@
# TokyoNight colors for Kitty
background #e1e2e7
foreground #3760bf
selection_background #99a7df
selection_foreground #3760bf
url_color #387068
cursor #3760bf
# Tabs
active_tab_background #2e7de9
active_tab_foreground #d4d6e4
inactive_tab_background #c4c8da
inactive_tab_foreground #8990b3
#tab_bar_background #e9e9ed
# normal
color0 #e9e9ed
color1 #f52a65
color2 #587539
color3 #8c6c3e
color4 #2e7de9
color5 #9854f1
color6 #007197
color7 #6172b0
# bright
color8 #a1a6c5
color9 #f52a65
color10 #587539
color11 #8c6c3e
color12 #2e7de9
color13 #9854f1
color14 #007197
color15 #3760bf
# extended colors
color16 #b15c00
color17 #c64343

View File

@ -43,7 +43,9 @@ function M.setup(config)
red1 = "#db4b4b", red1 = "#db4b4b",
git = { change = "#6183bb", add = "#449dab", delete = "#914c54", conflict = "#bb7a61" }, git = { change = "#6183bb", add = "#449dab", delete = "#914c54", conflict = "#bb7a61" },
} }
if config.style == "night" or vim.o.background == "light" then colors.bg = "#1a1b26" end if config.style == "night" or config.style == "day" or vim.o.background == "light" then
colors.bg = "#1a1b26"
end
util.bg = colors.bg util.bg = colors.bg
colors.diff = { colors.diff = {
@ -83,6 +85,10 @@ function M.setup(config)
util.color_overrides(colors, config) util.color_overrides(colors, config)
if config.transform_colors and (config.style == "day" or vim.o.background == "light") then
return util.light_colors(colors)
end
return colors return colors
end end

View File

@ -25,6 +25,7 @@ config = {
dev = opt("dev", false), dev = opt("dev", false),
darkFloat = opt("dark_float", true), darkFloat = opt("dark_float", true),
darkSidebar = opt("dark_sidebar", true), darkSidebar = opt("dark_sidebar", true),
transform_colors = false,
} }
if config.style == "day" then vim.o.background = "light" end if config.style == "day" then vim.o.background = "light" end

View File

@ -4,6 +4,7 @@ local M = {}
function M.alacritty(config) function M.alacritty(config)
config = config or require("tokyonight.config") config = config or require("tokyonight.config")
config.transform_colors = true
local colors = require("tokyonight.colors").setup(config) local colors = require("tokyonight.colors").setup(config)
local alacrittyColors = {} local alacrittyColors = {}

View File

@ -4,6 +4,7 @@ local M = {}
function M.fish(config) function M.fish(config)
config = config or require("tokyonight.config") config = config or require("tokyonight.config")
config.transform_colors = true
local colors = require("tokyonight.colors").setup(config) local colors = require("tokyonight.colors").setup(config)
local fishColors = {} local fishColors = {}

View File

@ -24,3 +24,9 @@ write(kitty.kitty(config), "kitty_tokyonight_night.conf")
write(fish.fish(config), "fish_tokyonight_night.fish") write(fish.fish(config), "fish_tokyonight_night.fish")
write(alacritty.alacritty(config), "alacritty_tokyonight_night.yml") write(alacritty.alacritty(config), "alacritty_tokyonight_night.yml")
config.style = "day"
write(kitty.kitty(config), "kitty_tokyonight_day.conf")
write(fish.fish(config), "fish_tokyonight_day.fish")
write(alacritty.alacritty(config), "alacritty_tokyonight_day.yml")

View File

@ -4,6 +4,7 @@ local M = {}
function M.kitty(config) function M.kitty(config)
config = config or require("tokyonight.config") config = config or require("tokyonight.config")
config.transform_colors = true
local colors = require("tokyonight.colors").setup(config) local colors = require("tokyonight.colors").setup(config)
local kitty = util.template([[ local kitty = util.template([[

View File

@ -166,6 +166,13 @@ function util.terminal(colors)
end end
end end
function util.light_colors(colors)
if type(colors) == "string" then return util.getColor(colors) end
local ret = {}
for key, value in pairs(colors) do ret[key] = util.light_colors(value) end
return ret
end
---@param theme Theme ---@param theme Theme
function util.load(theme) function util.load(theme)
vim.cmd("hi clear") vim.cmd("hi clear")