farout.nvim/lua/tokyonight/extra/alacritty.lua

60 lines
1.1 KiB
Lua
Raw Normal View History

2021-04-20 12:47:35 +00:00
local util = require("tokyonight.util")
local M = {}
function M.alacritty(config)
config = config or require("tokyonight.config")
2021-05-02 08:43:18 +00:00
config.transform_colors = true
2021-04-20 12:47:35 +00:00
local colors = require("tokyonight.colors").setup(config)
local alacrittyColors = {}
for k, v in pairs(colors) do
2021-05-12 09:19:28 +00:00
if type(v) == "string" then
alacrittyColors[k] = v:gsub("^#", "0x")
end
2021-04-20 12:47:35 +00:00
end
2021-05-12 09:19:28 +00:00
local alacritty = util.template(
[[
2021-04-20 12:47:35 +00:00
# TokyoNight Alacritty Colors
colors:
# Default colors
primary:
background: '${bg}'
foreground: '${fg}'
# Normal colors
normal:
black: '${black}'
red: '${red}'
green: '${green}'
yellow: '${yellow}'
blue: '${blue}'
magenta: '${magenta}'
cyan: '${cyan}'
white: '${fg_dark}'
# Bright colors
bright:
black: '${terminal_black}'
2021-04-20 12:47:35 +00:00
red: '${red}'
green: '${green}'
yellow: '${yellow}'
blue: '${blue}'
magenta: '${magenta}'
cyan: '${cyan}'
white: '${fg}'
indexed_colors:
- { index: 16, color: '${orange}' }
- { index: 17, color: '${red1}' }
2021-05-12 09:19:28 +00:00
]],
alacrittyColors
)
2021-04-20 12:47:35 +00:00
return alacritty
end
return M