First stab at converting to farout palette

Also renamed all/most instances of tokyonight to farout
This commit is contained in:
2023-12-01 15:30:50 -05:00
parent f247ee700b
commit 1752319cc5
130 changed files with 18963 additions and 301 deletions

View File

@@ -0,0 +1,56 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local alacrittyColors = {}
for k, v in pairs(colors) do
if type(v) == "string" then
alacrittyColors[k] = v:gsub("^#", "0x")
end
end
local alacritty = util.template(
[[
# FarOut 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}'
red: '${red}'
green: '${green}'
yellow: '${yellow}'
blue: '${blue}'
magenta: '${magenta}'
cyan: '${cyan}'
white: '${fg}'
indexed_colors:
- { index: 16, color: '${orange}' }
- { index: 17, color: '${red1}' }
]],
alacrittyColors
)
return alacritty
end
return M

View File

@@ -0,0 +1,27 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local delta = util.template(
[[
[delta]
minus-style = syntax "${diff.delete}"
minus-non-emph-style = syntax "${diff.delete}"
minus-emph-style = syntax "${delta.delete}"
minus-empty-line-marker-style = syntax "${diff.delete}"
line-numbers-minus-style = "${gitSigns.delete}"
plus-style = syntax "${diff.add}"
plus-non-emph-style = syntax "${diff.add}"
plus-emph-style = syntax "${delta.add}"
plus-empty-line-marker-style = syntax "${diff.add}"
line-numbers-plus-style = "${gitSigns.add}"
line-numbers-zero-style = "${fg_gutter}"
]],
colors
)
return delta
end
return M

View File

@@ -0,0 +1,32 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local dunst = util.template(
[[
# TokyoNight colors for dunst
# For more configuraion options see https://github.com/dunst-project/dunst/blob/master/dunstrc
[urgency_low]
background = "${bg_dark}"
foreground = "${fg}"
frame_color = "${fg}"
[urgency_normal]
background = "${bg}"
foreground = "${fg}"
frame_color = "${fg}"
[urgency_critical]
background = "${bg_highlight}"
foreground = "${error}"
frame_color = "${error}"
]],
colors
)
return dunst
end
return M

58
lua/farout/extra/fish.lua Normal file
View File

@@ -0,0 +1,58 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local fishColors = {}
for k, v in pairs(colors) do
if type(v) == "string" then
fishColors[k] = v:gsub("^#", "")
end
end
local fish = util.template(
[[
# TokyoNight Color Palette
set -l foreground ${fg}
set -l selection ${bg_visual}
set -l comment ${comment}
set -l red ${red}
set -l orange ${orange}
set -l yellow ${yellow}
set -l green ${green}
set -l purple ${purple}
set -l cyan ${cyan}
set -l pink ${magenta}
# 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
set -g fish_pager_color_selected_background --background=$selection
]],
fishColors
)
return fish
end
return M

View File

@@ -0,0 +1,47 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local fishColors = {}
for k, v in pairs(colors) do
if type(v) == "string" then
fishColors[k] = v:gsub("^#", "")
end
end
local fish = util.template(
[[
# TokyoNight
# Syntax Highlighting Colors
fish_color_normal ${fg}
fish_color_command ${cyan}
fish_color_keyword ${magenta}
fish_color_quote ${yellow}
fish_color_redirection ${fg}
fish_color_end ${orange}
fish_color_error ${red}
fish_color_param ${purple}
fish_color_comment ${comment}
fish_color_selection --background=${bg_visual}
fish_color_search_match --background=${bg_visual}
fish_color_operator ${green}
fish_color_escape ${magenta}
fish_color_autosuggestion ${comment}
# Completion Pager Colors
fish_pager_color_progress ${comment}
fish_pager_color_prefix ${cyan}
fish_pager_color_completion ${fg}
fish_pager_color_description ${comment}
fish_pager_color_selected_background --background=${bg_visual}
]],
fishColors
)
return fish
end
return M

52
lua/farout/extra/foot.lua Normal file
View File

@@ -0,0 +1,52 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local footColors = {}
for k, v in pairs(colors) do
if type(v) == "string" then
footColors[k] = v:gsub("^#", "")
end
end
local foot = util.template(
[[
[cursor]
color=${fg} ${bg_visual}
[colors]
foreground=${fg}
background=${bg}
selection-foreground=${fg}
selection-background=${bg_visual}
urls=${green1}
regular0=${black}
regular1=${red}
regular2=${green}
regular3=${yellow}
regular4=${blue}
regular5=${magenta}
regular6=${cyan}
regular7=${fg_dark}
bright0=${terminal_black}
bright1=${red}
bright2=${green}
bright3=${yellow}
bright4=${blue}
bright5=${magenta}
bright6=${cyan}
bright7=${fg}
16=${orange}
17=${red1}]],
footColors
)
return foot
end
return M

View File

@@ -0,0 +1,56 @@
local util = require("farout.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

454
lua/farout/extra/helix.lua Normal file
View File

@@ -0,0 +1,454 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
-- Ref: https://github.com/helix-editor/helix/blob/master/book/src/themes.md
-- nil is used when no equivalent was found.
local mapping = M.flatten({
attribute = "@attribute",
type = {
"Type",
builtin = "@type.builtin",
enum = {
"@lsp.type.enum",
variant = "@lsp.type.enumMember",
},
},
-- rust: pattern matching `let Some(_) = ...`
-- ^^^^
constructor = "Type",
constant = {
"Constant",
builtin = {
"@constant.builtin",
boolean = "Boolean",
},
character = {
"Character",
escape = "@string.escape",
},
numeric = {
"Number",
float = "Float",
integer = "Number",
},
},
string = {
"String",
regexp = "@string.regex",
special = {
"@string.special",
path = nil,
url = nil,
symbol = nil,
},
},
comment = {
"@comment",
line = nil,
block = {
nil,
-- not sure about that one
documentation = "@string.documentation",
},
},
variable = {
"@variable",
builtin = "@variable.builtin",
parameter = "@parameter",
other = {
nil,
member = "@field",
},
},
label = "@label",
keyword = {
"@keyword",
control = {
"Statement",
conditional = "Conditional",
["repeat"] = "Repeat",
import = nil,
["return"] = "@keyword.return",
exception = "Exception",
},
operator = "Statement",
directive = "PreProc",
["function"] = "@keyword.function",
storage = {
nil, -- rust: `let`
type = nil, -- rust: `struct` & `type`
modifier = nil, -- rust: `mut`
},
},
operator = "Operator",
["function"] = {
"Function",
builtin = "@function.builtin",
method = "@method",
macro = "@function.macro",
-- Defined as "preprocessor in C", so using "PreProc", not sure though
special = "PreProc",
},
tag = {
"@tag",
-- ???
builtin = nil,
},
namespace = "@namespace",
special = "Special",
markup = {
nil,
heading = {
"@text.title",
marker = nil,
-- post-processed to remove the 'h' as we already use the first element (1) as the root value.
h1 = nil,
h2 = nil,
h3 = nil,
h4 = nil,
h5 = nil,
h6 = nil,
-- UI --
completion = "Pmenu",
hover = "PmenuSel",
},
list = {
"markdownHeadingDelimiter",
unnumbered = nil,
numbered = nil,
checked = nil,
unchecked = nil,
},
bold = "Bold",
italic = "Italic",
strikethrough = {
"helix",
modifiers = { "crossed_out" },
},
link = {
"markdownLinkText",
url = "Underlined",
label = "markdownCode",
text = "markdownCode",
},
quote = nil,
raw = {
"markdownCode",
inline = "@text.literal.markdown_inline",
block = "markdownCodeBlock",
-- UI --
completion = nil,
hover = nil,
},
-- UI --
normal = {
nil,
completion = "CmpItemMenu",
hover = "CmpItemKindDefault",
},
},
diff = {
nil,
plus = "diffAdded",
minus = "diffRemoved",
delta = {
"diffChanged",
moved = "diffFile",
},
},
ui = {
background = {
{ "helix", bg = "bg" },
separator = nil,
},
cursor = {
"Cursor",
normal = nil,
insert = nil,
select = nil,
match = "MatchParen",
primary = {
nil,
normal = nil,
insert = nil,
select = nil,
},
},
debug = {
breakpoint = nil,
active = nil,
},
gutter = {
nil,
selected = nil,
},
highlight = {
nil,
frameline = nil,
},
linenr = {
"LineNr",
select = "CursorLineNr",
},
statusline = {
"StatusLine",
inactive = "StatusLineNc",
-- Inspired from lualine
normal = {
"helix",
bg = "blue",
fg = "black",
},
insert = nil,
select = nil,
separator = nil,
},
popup = {
"TelescopeBorder",
info = nil,
},
window = "WinSeparator",
help = nil,
text = {
"Normal",
-- TelescopeSelection
focus = "Visual",
inactive = "Comment",
info = "TelescopeNormal",
},
virtual = {
ruler = nil,
whitespace = nil,
["indent-guide"] = nil,
["inlay-hint"] = {
"DiagnosticVirtualTextHint",
parameter = nil,
type = nil,
},
wrap = nil,
},
menu = {
"Pmenu",
selected = "PmenuSel",
scroll = {
"helix",
fg = vim.api.nvim_get_hl(0, { name = "PmenuThumb" }).bg,
bg = vim.api.nvim_get_hl(0, { name = "PmenuSbar" }).bg,
},
},
selection = {
{ "helix", bg = "bg_highlight" },
primary = nil,
},
cursorline = {
primary = nil,
secondary = nil,
},
cursorcolumn = {
primary = nil,
secondary = nil,
},
},
hint = "DiagnosticHint",
info = "DiagnosticInfo",
warning = "DiagnosticWarn",
error = "DiagnosticError",
diagnostic = {
nil,
hint = "DiagnosticUnderlineHint",
info = "DiagnosticUnderlineInfo",
warning = "DiagnosticUnderlineWarn",
error = "DiagnosticUnderlineError",
},
})
local config = {}
for hx_scope, group in M.pairsByKeys(mapping) do
-- print(hx_scope, util.dump(group))
hx_scope = hx_scope:gsub("%.h(%d)", ".%1")
if hx_scope:match("%.") then
hx_scope = '"' .. hx_scope .. '"'
end
if group == nil then
goto continue
end
if type(group) == "table" and group[1] == "helix" then
table.remove(group, 1)
table.insert(config, string.format("%s = %s", hx_scope, M.to_toml(group)))
goto continue
end
local highlight = vim.api.nvim_get_hl(0, { name = group })
while highlight and highlight.link do
highlight = vim.api.nvim_get_hl(0, { name = highlight.link })
end
if highlight == nil then
print("Unknown highlight for " .. hx_scope)
goto continue
end
table.insert(config, string.format("%s = %s", hx_scope, M.to_helix_config(highlight)))
::continue::
end
table.insert(config, "\n[palette]")
for name, color in M.pairsByKeys(M.flatten(colors)) do
if name:match("%.") then
name = '"' .. name .. '"'
end
if type(color) == "string" and not string.starts(name, "_") and name ~= "none" then
table.insert(config, string.format('%s = "%s"', name, color))
end
end
return table.concat(config, "\n")
end
function string.starts(String, Start)
return string.sub(String, 1, string.len(Start)) == Start
end
function M.flatten(t)
local res = {}
for k, v in pairs(t) do
if type(v) == "table" then
if v[1] ~= "helix" then
for k2, v2 in pairs(M.flatten(v)) do
-- Special case for tables like:
-- { type = { "@type", enum = "@type.enum" } }
if k2 == 1 then
res[k] = v2
else
res[k .. "." .. k2] = v2
end
end
else
res[k] = v
end
else
res[k] = v
end
end
return res
end
-- https://www.lua.org/pil/19.3.html
function M.pairsByKeys(t, f)
local a = {}
for n in pairs(t) do
table.insert(a, n)
end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function() -- iterator function
i = i + 1
if a[i] == nil then
return nil
else
return a[i], t[a[i]]
end
end
return iter
end
function M.to_helix_config(highlight)
local style = {}
for hx_name, nvim_name in pairs({ fg = "fg", bg = "bg" }) do
style[hx_name] = M.to_rgb(highlight[nvim_name])
end
local modifiers = {}
for _, mods in ipairs({ highlight, highlight.cterm }) do
if mods then
if mods.bold then
modifiers.bold = true
end
if mods.italic then
modifiers.italic = true
end
if mods.underline then
style.underline = {
style = "line",
}
end
if mods.undercurl and highlight.sp then
style.underline = {
color = M.to_rgb(mods.sp),
style = "curl",
}
end
end
end
if next(modifiers) ~= nil then
style.modifiers = M.key_set(modifiers)
end
return M.to_toml(style)
end
function M.to_rgb(color)
if type(color) == "string" then
return color
elseif type(color) == "number" then
return string.format("#%06x", color)
end
end
function M.key_set(t)
local keys = {}
for key, _ in pairs(t) do
table.insert(keys, key)
end
return keys
end
function M.to_toml(style)
local buffer = {}
M.insert_as_toml(buffer, style)
return table.concat(buffer, "")
end
function M.insert_as_toml(buffer, x)
if type(x) == "table" then
if next(x) == nil then
return
end
if M.is_array(x) then
table.insert(buffer, "[")
for _, v in pairs(x) do
M.insert_as_toml(buffer, v)
table.insert(buffer, ", ")
end
table.remove(buffer)
table.insert(buffer, "]")
else
table.insert(buffer, "{ ")
for k, v in M.pairsByKeys(x) do
table.insert(buffer, string.format("%s = ", k))
M.insert_as_toml(buffer, v)
table.insert(buffer, ", ")
end
table.remove(buffer)
table.insert(buffer, " }")
end
elseif type(x) == "string" then
table.insert(buffer, '"' .. x .. '"')
elseif type(x) ~= nil then
table.insert(buffer, tostring(x))
end
end
function M.is_array(t)
local i = 0
for _ in pairs(t) do
i = i + 1
if t[i] == nil then
return false
end
end
return true
end
return M

98
lua/farout/extra/init.lua Normal file
View File

@@ -0,0 +1,98 @@
local M = {}
-- map of plugin name to plugin extension
--- @type table<string, {ext:string, url:string, label:string}>
-- stylua: ignore
M.extras = {
kitty = {ext = "conf", url = "https://sw.kovidgoyal.net/kitty/conf.html", label = "Kitty"},
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"},
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"},
xfceterm = {ext = "theme", url = "https://docs.xfce.org/apps/terminal/advanced", label = "Xfce Terminal"},
foot = {ext = "ini", url = "https://codeberg.org/dnkl/foot", label = "Foot"},
tilix = {ext = "json", url = "https://github.com/gnunn1/tilix", label = "Tilix"},
iterm = {ext = "itermcolors", url = "https://iterm2.com/", label = "iTerm"},
lua = {ext = "lua", url = "https://www.lua.org", label = "Lua Table for testing"},
sublime = {ext = "tmTheme", url = "https://www.sublimetext.com/docs/themes", label = "Sublime Text"},
delta = {ext = "gitconfig", url = "https://github.com/dandavison/delta", label = "Delta"},
terminator = {ext = "conf", url = "https://gnome-terminator.readthedocs.io/en/latest/config.html", label = "Terminator"},
prism = {ext = "js", url = "https://prismjs.com", label = "Prism"},
windows_terminal = {ext = "json", url = "https://aka.ms/terminal-documentation", label = "Windows Terminal"},
zathura = {ext = "zathurarc", url = "https://pwmt.org/projects/zathura/", label = "Zathura"},
dunst = {ext = "dunstrc", url = "https://dunst-project.org/", label = "Dunst"},
gitui = {ext = "ron", url = "https://github.com/extrawurst/gitui", label = "GitUI"},
helix = { ext = "toml", url = "https://helix-editor.com/", label = "Helix"},
}
local function write(str, fileName)
print("[write] extra/" .. fileName)
vim.fn.mkdir(vim.fs.dirname("extras/" .. fileName), "p")
local file = io.open("extras/" .. fileName, "w")
file:write(str)
file:close()
end
function M.read_file(file)
local fd = assert(io.open(file, "r"))
---@type string
local data = fd:read("*a")
fd:close()
return data
end
function M.write_file(file, contents)
local fd = assert(io.open(file, "w+"))
fd:write(contents)
fd:close()
end
function M.docs()
local file = vim.fn.fnamemodify(debug.getinfo(1, "S").source:sub(2), ":p:h:h:h:h") .. "/README.md"
local tag = "extras"
local pattern = "(<%!%-%- " .. tag .. ":start %-%->).*(<%!%-%- " .. tag .. ":end %-%->)"
local readme = M.read_file(file)
local lines = {}
local names = vim.tbl_keys(M.extras)
table.sort(names)
for _, name in ipairs(names) do
local info = M.extras[name]
table.insert(lines, "- [" .. info.label .. "](" .. info.url .. ") ([" .. name .. "](extras/" .. name .. "))")
end
readme = readme:gsub(pattern, "%1\n" .. table.concat(lines, "\n") .. "\n%2")
M.write_file(file, readme)
end
function M.setup()
M.docs()
local farout = require("farout")
vim.o.background = "dark"
-- map of style to style name
local styles = {
storm = " Storm",
night = "",
day = " Day",
moon = " Moon",
}
for extra, info in pairs(M.extras) do
package.loaded["farout.extra." .. extra] = nil
local plugin = require("farout.extra." .. extra)
for style, style_name in pairs(styles) do
farout.setup({ style = style })
farout.load({ style = style })
vim.cmd.colorscheme("farout-" .. style)
local colors = require("farout.colors").setup({ transform = true })
local fname = extra .. "/farout" .. style .. "." .. info.ext
colors["_upstream_url"] = "https://github.com/thallada/farout.nvim/raw/main/extras/" .. fname
colors["_style_name"] = "FarOut" .. style_name
colors["_name"] = "farout" .. style
write(plugin.generate(colors), fname)
end
end
end
return M

375
lua/farout/extra/iterm.lua Normal file
View File

@@ -0,0 +1,375 @@
local function get_component(hex, component)
hex = hex:gsub("#", "")
local num
if component == "r" then
num = tonumber("0x" .. hex:sub(1, 2)) / 255
elseif component == "g" then
num = tonumber("0x" .. hex:sub(3, 4)) / 255
elseif component == "b" then
num = tonumber("0x" .. hex:sub(5, 6)) / 255
end
return string.format("%.16f", num)
end
local function template(str, table)
return (str:gsub("($%b{})", function(w)
return get_component(table[w:sub(3, -4)], w:sub(-2, -2))
end))
end
local M = {}
function M.generate(colors)
local iterm = template([[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${black.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${black.g}</real>
<key>Red Component</key>
<real>${black.r}</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${red.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${red.g}</real>
<key>Red Component</key>
<real>${red.r}</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${green.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${green.g}</real>
<key>Red Component</key>
<real>${green.r}</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${yellow.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${yellow.g}</real>
<key>Red Component</key>
<real>${yellow.r}</real>
</dict>
<key>Ansi 12 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${blue.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${blue.g}</real>
<key>Red Component</key>
<real>${blue.r}</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${magenta.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${magenta.g}</real>
<key>Red Component</key>
<real>${magenta.r}</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${cyan.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${cyan.g}</real>
<key>Red Component</key>
<real>${cyan.r}</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${fg.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${fg.g}</real>
<key>Red Component</key>
<real>${fg.r}</real>
</dict>
<key>Ansi 2 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${green.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${green.g}</real>
<key>Red Component</key>
<real>${green.r}</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${yellow.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${yellow.g}</real>
<key>Red Component</key>
<real>${yellow.r}</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${blue.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${blue.g}</real>
<key>Red Component</key>
<real>${blue.r}</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${magenta.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${magenta.g}</real>
<key>Red Component</key>
<real>${magenta.r}</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${cyan.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${cyan.g}</real>
<key>Red Component</key>
<real>${cyan.r}</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${fg_dark.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${fg_dark.g}</real>
<key>Red Component</key>
<real>${fg_dark.r}</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${terminal_black.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${terminal_black.g}</real>
<key>Red Component</key>
<real>${terminal_black.r}</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${red.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${red.g}</real>
<key>Red Component</key>
<real>${red.r}</real>
</dict>
<key>Background Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${bg.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${bg.g}</real>
<key>Red Component</key>
<real>${bg.r}</real>
</dict>
<key>Badge Color</key>
<dict>
<key>Alpha Component</key>
<real>0.5</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.1491314172744751</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Bold Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${teal.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${teal.g}</real>
<key>Red Component</key>
<real>${teal.r}</real>
</dict>
<key>Cursor Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${fg.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${fg.g}</real>
<key>Red Component</key>
<real>${fg.r}</real>
</dict>
<key>Cursor Guide Color</key>
<dict>
<key>Alpha Component</key>
<real>0.25</real>
<key>Blue Component</key>
<real>${fg.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${fg.g}</real>
<key>Red Component</key>
<real>${fg.r}</real>
</dict>
<key>Cursor Text Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${bg.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${bg.g}</real>
<key>Red Component</key>
<real>${bg.r}</real>
</dict>
<key>Foreground Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${fg.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${fg.g}</real>
<key>Red Component</key>
<real>${fg.r}</real>
</dict>
<key>Link Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${green1.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${green1.g}</real>
<key>Red Component</key>
<real>${green1.r}</real>
</dict>
<key>Selected Text Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${fg.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${fg.g}</real>
<key>Red Component</key>
<real>${fg.r}</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>${bg_visual.b}</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>${bg_visual.g}</real>
<key>Red Component</key>
<real>${bg_visual.r}</real>
</dict>
</dict>
</plist>]],
colors
)
return iterm
end
return M
-- vim: sw=2

View File

@@ -0,0 +1,65 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local kitty = util.template(
[[
# vim:ft=kitty
## name: ${_style_name}
## license: MIT
## author: Folke Lemaitre
## upstream: ${_upstream_url}
background ${bg}
foreground ${fg}
selection_background ${bg_visual}
selection_foreground ${fg}
url_color ${green1}
cursor ${fg}
cursor_text_color ${bg}
# Tabs
active_tab_background ${blue}
active_tab_foreground ${bg_dark}
inactive_tab_background ${bg_highlight}
inactive_tab_foreground ${dark3}
#tab_bar_background ${black}
# Windows
active_border_color ${blue}
inactive_border_color ${bg_highlight}
# normal
color0 ${black}
color1 ${red}
color2 ${green}
color3 ${yellow}
color4 ${blue}
color5 ${magenta}
color6 ${cyan}
color7 ${fg_dark}
# bright
color8 ${terminal_black}
color9 ${red}
color10 ${green}
color11 ${yellow}
color12 ${blue}
color13 ${magenta}
color14 ${cyan}
color15 ${fg}
# extended colors
color16 ${orange}
color17 ${red1}
]],
colors
)
return kitty
end
return M

28
lua/farout/extra/lua.lua Normal file
View File

@@ -0,0 +1,28 @@
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local function deepcopy(tbl)
local ret = tbl
if type(tbl) == "table" then
ret = {}
for key, value in pairs(tbl) do
ret[key] = deepcopy(value)
end
end
return ret
end
colors = vim.deepcopy(colors)
colors._upstream_url = nil
colors._style_name = nil
local ret = "local colors = "
.. vim.inspect(colors)
.. "\n\nlocal highlights = "
.. vim.inspect(deepcopy(require("farout.theme").setup().highlights))
.. "\n"
return ret
end
return M

View File

@@ -0,0 +1,88 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
return util.template(M.template, colors)
end
M.template = [[
module.exports = {
plain: {
color: "${fg}",
backgroundColor: "${bg}",
},
styles: [
{
types: ["prolog", "builtin"],
style: {
color: "${red}",
},
},
{
types: ["function"],
style: {
color: "${blue}",
},
},
{
types: ["symbol"],
style: {
color: "${blue1}",
},
},
{
types: ["punctuation"],
style: {
color: "${magenta}",
},
},
{
types: ["string", "char", "tag", "selector"],
style: {
color: "${green}",
},
},
{
types: ["keyword"],
style: {
color: "${purple}",
},
},
{
types: ["operator"],
style: {
color: "${blue5}",
},
},
{
types: ["constant", "boolean"],
style: {
color: "${orange}",
},
},
{
types: ["variable"],
style: {
color: "${fg}",
},
},
{
types: ["comment"],
style: {
color: "${comment}",
fontStyle: "italic",
},
},
{
types: ["attr-name"],
style: {
color: "rgb(241, 250, 140)",
},
},
],
};
]]
return M

1379
lua/farout/extra/sublime.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local terminator = util.template(
[=[
[[${_style_name}]]
palette = "${black}:${red}:${green}:${yellow}:${blue}:${magenta}:${cyan}:${fg_dark}:${terminal_black}:${red}:${green}:${yellow}:${blue}:${magenta}:${cyan}:${purple}"
background_color = "${bg}"
foreground_color = "${fg}"
]=],
colors
)
return terminator
end
return M

View File

@@ -0,0 +1,40 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local tilix = util.template(
[[
{
"name": "${_style_name}",
"comment": "",
"use-theme-colors": false,
"foreground-color": "${fg}",
"background-color": "${bg}",
"palette": [
"${black}",
"${red}",
"${green}",
"${yellow}",
"${blue}",
"${magenta}",
"${cyan}",
"${fg_dark}",
"${terminal_black}",
"${red}",
"${green}",
"${yellow}",
"${blue}",
"${magenta}",
"${cyan}",
"${fg}"
]
}
]],
colors
)
return tilix
end
return M

53
lua/farout/extra/tmux.lua Normal file
View File

@@ -0,0 +1,53 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local tmux = util.template(
[[
#!/usr/bin/env bash
# FarOut colors for Tmux
set -g mode-style "fg=${blue},bg=${fg_gutter}"
set -g message-style "fg=${blue},bg=${fg_gutter}"
set -g message-command-style "fg=${blue},bg=${fg_gutter}"
set -g pane-border-style "fg=${fg_gutter}"
set -g pane-active-border-style "fg=${blue}"
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=${blue},bg=${bg_statusline}"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style ${none}
set -g status-right-style ${none}
set -g status-left "#[fg=${black},bg=${blue},bold] #S #[fg=${blue},bg=${bg_statusline},nobold,nounderscore,noitalics]"
set -g status-right "#[fg=${bg_statusline},bg=${bg_statusline},nobold,nounderscore,noitalics]#[fg=${blue},bg=${bg_statusline}] #{prefix_highlight} #[fg=${fg_gutter},bg=${bg_statusline},nobold,nounderscore,noitalics]#[fg=${blue},bg=${fg_gutter}] %Y-%m-%d  %I:%M %p #[fg=${blue},bg=${fg_gutter},nobold,nounderscore,noitalics]#[fg=${black},bg=${blue},bold] #h "
if-shell '[ "$(tmux show-option -gqv "clock-mode-style")" == "24" ]' {
set -g status-right "#[fg=${bg_statusline},bg=${bg_statusline},nobold,nounderscore,noitalics]#[fg=${blue},bg=${bg_statusline}] #{prefix_highlight} #[fg=${fg_gutter},bg=${bg_statusline},nobold,nounderscore,noitalics]#[fg=${blue},bg=${fg_gutter}] %Y-%m-%d  %H:%M #[fg=${blue},bg=${fg_gutter},nobold,nounderscore,noitalics]#[fg=${black},bg=${blue},bold] #h "
}
setw -g window-status-activity-style "underscore,fg=${fg_sidebar},bg=${bg_statusline}"
setw -g window-status-separator ""
setw -g window-status-style "${none},fg=${fg_sidebar},bg=${bg_statusline}"
setw -g window-status-format "#[fg=${bg_statusline},bg=${bg_statusline},nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=${bg_statusline},bg=${bg_statusline},nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=${bg_statusline},bg=${fg_gutter},nobold,nounderscore,noitalics]#[fg=${blue},bg=${fg_gutter},bold] #I  #W #F #[fg=${fg_gutter},bg=${bg_statusline},nobold,nounderscore,noitalics]"
# tmux-plugins/tmux-prefix-highlight support
set -g @prefix_highlight_output_prefix "#[fg=${yellow}]#[bg=${bg_statusline}]#[fg=${bg_statusline}]#[bg=${yellow}]"
set -g @prefix_highlight_output_suffix ""
]],
colors
)
return tmux
end
return M

View File

@@ -0,0 +1,58 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local wezterm = util.template(
[[
[colors]
foreground = "${fg}"
background = "${bg}"
cursor_bg = "${fg}"
cursor_border = "${fg}"
cursor_fg = "${bg}"
selection_bg = "${bg_visual}"
selection_fg = "${fg}"
split = "${blue}"
compose_cursor = "${orange}"
ansi = ["${black}", "${red}", "${green}", "${yellow}", "${blue}", "${magenta}", "${cyan}", "${fg_dark}"]
brights = ["${terminal_black}", "${red}", "${green}", "${yellow}", "${blue}", "${magenta}", "${cyan}", "${fg}"]
[colors.tab_bar]
inactive_tab_edge = "${bg_dark}"
background = "${bg}"
[colors.tab_bar.active_tab]
fg_color = "${bg_dark}"
bg_color = "${blue}"
[colors.tab_bar.inactive_tab]
fg_color = "${dark3}"
bg_color = "${bg_highlight}"
[colors.tab_bar.inactive_tab_hover]
fg_color = "${blue}"
bg_color = "${bg_highlight}"
# intensity = "Bold"
[colors.tab_bar.new_tab_hover]
fg_color = "${blue}"
bg_color = "${bg}"
intensity = "Bold"
[colors.tab_bar.new_tab]
fg_color = "${blue}"
bg_color = "${bg}"
[metadata]
aliases = []
author = "folke"
name = "${_name}"]],
colors
)
return wezterm
end
return M

View File

@@ -0,0 +1,41 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local windows_terminal = util.template(
[[
# Add the following object to your Windows Terminal configuration
# https://learn.microsoft.com/en-us/windows/terminal/customize-settings/color-schemes#creating-your-own-color-scheme
{
"background": "${bg}",
"black": "${black}",
"blue": "${blue}",
"brightBlack": "${terminal_black}",
"brightBlue": "${blue}",
"brightCyan": "${cyan}",
"brightGreen": "${green}",
"brightPurple": "${purple}",
"brightRed": "${red}",
"brightWhite": "${fg}",
"brightYellow": "${yellow}",
"cursorColor": "${fg}",
"cyan": "${cyan}",
"foreground": "${fg}",
"green": "${green}",
"name": "${_style_name}",
"purple": "${magenta}",
"red": "${red}",
"selectionBackground": "${bg_visual}",
"white": "${fg_dark}",
"yellow": "${yellow}"
}
]],
colors
)
return windows_terminal
end
return M

View File

@@ -0,0 +1,24 @@
local util = require("farout.util")
local M = {}
-- @param colors ColorScheme
function M.generate(colors)
local xfceterm = util.template(
[[
[Scheme]
Name=FarOut Colors
ColorBackground=${bg}
ColorForeground=${fg}
ColorSelectionBackground=${bg_visual}
ColorSelection=${fg}
ColorPalette=${black};${red};${green};${yellow};${blue};${magenta};${cyan};${fg_dark};${terminal_black};${red};${green};${yellow};${blue};${magenta};${cyan};${fg}
]],
colors
)
return xfceterm
end
return M

View File

@@ -0,0 +1,38 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local xr = util.template(
[[
! FarOut colors for Xresources
*background: ${bg}
*foreground: ${fg}
*color0: ${black}
*color1: ${red}
*color2: ${green}
*color3: ${yellow}
*color4: ${blue}
*color5: ${magenta}
*color6: ${cyan}
*color7: ${fg_dark}
*color8: ${terminal_black}
*color9: ${red}
*color10: ${green}
*color11: ${yellow}
*color12: ${blue}
*color13: ${magenta}
*color14: ${cyan}
*color15: ${fg}
]],
colors
)
return xr
end
return M

View File

@@ -0,0 +1,53 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local zathura = util.template(
[[
# Tokyonight color theme for Zathura
# Swaps Foreground for Background to get a light version if the user prefers
#
# Tokyonight color theme
#
set notification-error-bg "${red}"
set notification-error-fg "${fg}"
set notification-warning-bg "${yellow}"
set notification-warning-fg "${terminal_black}"
set notification-bg "${bg}"
set notification-fg "${fg}"
set completion-bg "${bg}"
set completion-fg "${fg_dark}"
set completion-group-bg "${bg}"
set completion-group-fg "${fg_dark}"
set completion-highlight-bg "${terminal_black}"
set completion-highlight-fg "${fg}"
set index-bg "${bg}"
set index-fg "${fg}"
set index-active-bg "${terminal_black}"
set index-active-fg "${fg}"
set inputbar-bg "${bg}"
set inputbar-fg "${fg}"
set statusbar-bg "${bg}"
set statusbar-fg "${fg}"
set highlight-color "${yellow}"
set highlight-active-color "${green}"
set default-bg "${bg}"
set default-fg "${fg}"
set render-loading true
set render-loading-fg "${bg}"
set render-loading-bg "${fg}"
#
# Recolor mode settings
# <C-r> to switch modes
#
set recolor-lightcolor "${bg}"
set recolor-darkcolor "${fg}"
]],
colors
)
return zathura
end
return M