From fcbef3dcde1fdde36d84868f076dcd51c9341094 Mon Sep 17 00:00:00 2001 From: Pau Garcia Chiner <49660697+pauchiner@users.noreply.github.com> Date: Mon, 12 Feb 2024 19:56:26 +0100 Subject: [PATCH] feat(extra): add warp terminal to the extras --- lua/pastelnight/extra/init.lua | 1 + lua/pastelnight/extra/warp.lua | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 lua/pastelnight/extra/warp.lua diff --git a/lua/pastelnight/extra/init.lua b/lua/pastelnight/extra/init.lua index e8807fe..2d06c96 100644 --- a/lua/pastelnight/extra/init.lua +++ b/lua/pastelnight/extra/init.lua @@ -8,6 +8,7 @@ M.extras = { fish = { ext = "fish", url = "https://fishshell.com/docs/current/index.html", label = "Fish" }, fish_themes = { ext = "theme", url = "https://fishshell.com/docs/current/interactive.html#syntax-highlighting", label = "Fish Themes" }, alacritty = { ext = "yml", url = "https://github.com/alacritty/alacritty", label = "Alacritty" }, + warp = { ext = "yaml", url = "https://docs.warp.dev/appearance/custom-themes", label = "Warp" }, wezterm = { ext = "toml", url = "https://wezfurlong.org/wezterm/config/files.html", label = "WezTerm" }, tmux = { ext = "tmux", url = "https://github.com/tmux/tmux/wiki", label = "Tmux" }, xresources = { ext = "Xresources", url = "https://wiki.archlinux.org/title/X_resources", label = "Xresources" }, diff --git a/lua/pastelnight/extra/warp.lua b/lua/pastelnight/extra/warp.lua new file mode 100644 index 0000000..fa3b051 --- /dev/null +++ b/lua/pastelnight/extra/warp.lua @@ -0,0 +1,46 @@ +local util = require('pastelnight.util') + +local M = {} + +--- @param colors ColorScheme +function M.generate(colors) + local warpColors = {} + for k, v in pairs(colors) do + if type(v) == 'string' then + warpColors[k] = v:gsub('^#', '0x') + end + end + + local warp = util.template( + [[ +accent: '${purple}' +background: '${bg}' +details: darker +foreground: '${fg}' +terminal_colors: + bright: + black: '${base900}' + blue: '${blue}' + cyan: '${sky}' + green: '${green}' + magenta: '${purple}' + red: '${red}' + white: '${base50}' + yellow: '${yellow}' + normal: + black: '${black}' + blue: '${blue}' + cyan: '${sky}' + green: '${green}' + magenta: '${purple}' + red: '${red}' + white: '${fg}' + yellow: '${yellow}' + ]], + warpColors + ) + + return warp +end + +return M