feat(extra): add gitui theme (#397)

* feat: add gitui theme

* fix: command bar extra lines bg
This commit is contained in:
Adriano
2023-06-21 10:14:20 +01:00
committed by GitHub
parent 9a0deaa852
commit b39627bfea
2 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
local util = require("tokyonight.util")
local function hex2rgb(key, value)
local hex = value:gsub("#", "")
local r = tonumber(hex:sub(1, 2), 16)
local g = tonumber(hex:sub(3, 4), 16)
local b = tonumber(hex:sub(5, 6), 16)
return string.format("Rgb(%s,%s,%s), // %s %s", r, g, b, key, value)
end
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local gitui_colors = {}
for k, v in pairs(colors) do
if type(v) == "string" then
gitui_colors[k] = hex2rgb(k, v)
end
end
local gitui = util.template(
[[
(
selected_tab: ${magenta}
command_fg: ${comment}
selection_bg: ${bg_highlight}
selection_fg: ${cyan}
cmdbar_bg: ${bg}
cmdbar_extra_lines_bg: ${bg}
disabled_fg: ${comment}
diff_line_add: ${green}
diff_line_delete: ${red}
diff_file_added: ${green1}
diff_file_removed: ${red1}
diff_file_moved: ${magenta2}
diff_file_modified: ${yellow}
commit_hash: ${magenta}
commit_time: ${teal}
commit_author: ${green}
danger_fg: ${red}
push_gauge_bg: ${bg}
push_gauge_fg: ${fg}
tag_fg: ${magenta2}
branch_fg: ${yellow}
)
]],
gitui_colors
)
return gitui
end
return M

View File

@@ -23,6 +23,7 @@ M.extras = {
windows_terminal = {ext = "json", url = "https://aka.ms/terminal-documentation", label = "Windows Terminal"}, windows_terminal = {ext = "json", url = "https://aka.ms/terminal-documentation", label = "Windows Terminal"},
zathura = {ext = "zathurarc", url = "https://pwmt.org/projects/zathura/", label = "Zathura"}, zathura = {ext = "zathurarc", url = "https://pwmt.org/projects/zathura/", label = "Zathura"},
dunst = {ext = "dunstrc", url = "https://dunst-project.org/", label = "Dunst"}, dunst = {ext = "dunstrc", url = "https://dunst-project.org/", label = "Dunst"},
gitui = {ext = "ron", url = "https://github.com/extrawurst/gitui", label = "GitUI"},
} }
local function write(str, fileName) local function write(str, fileName)