breaking: colors_map return a map-like table instead of list
This commit is contained in:
@@ -46,33 +46,33 @@ end
|
||||
local function to_iterm(colorscheme)
|
||||
local specs, term = unpack(colorscheme)
|
||||
local colors = {
|
||||
["Ansi 0"] = term[1],
|
||||
["Ansi 1"] = term[2],
|
||||
["Ansi 2"] = term[3],
|
||||
["Ansi 3"] = term[4],
|
||||
["Ansi 4"] = term[5],
|
||||
["Ansi 5"] = term[6],
|
||||
["Ansi 6"] = term[7],
|
||||
["Ansi 7"] = term[8],
|
||||
["Ansi 8"] = term[9],
|
||||
["Ansi 9"] = term[10],
|
||||
["Ansi 10"] = term[11],
|
||||
["Ansi 11"] = term[12],
|
||||
["Ansi 12"] = term[13],
|
||||
["Ansi 13"] = term[14],
|
||||
["Ansi 14"] = term[15],
|
||||
["Ansi 15"] = term[16],
|
||||
Foreground = specs.Normal.fg,
|
||||
Background = specs.Normal.bg,
|
||||
Bold = term[9],
|
||||
Cursor = specs.Cursor.bg,
|
||||
["Ansi 0"] = term.black,
|
||||
["Ansi 1"] = term.red,
|
||||
["Ansi 2"] = term.green,
|
||||
["Ansi 3"] = term.yellow,
|
||||
["Ansi 4"] = term.blue,
|
||||
["Ansi 5"] = term.magenta,
|
||||
["Ansi 6"] = term.cyan,
|
||||
["Ansi 7"] = term.white,
|
||||
["Ansi 8"] = term.bright_black,
|
||||
["Ansi 9"] = term.bright_red,
|
||||
["Ansi 10"] = term.bright_green,
|
||||
["Ansi 11"] = term.bright_yellow,
|
||||
["Ansi 12"] = term.bright_blue,
|
||||
["Ansi 13"] = term.bright_magenta,
|
||||
["Ansi 14"] = term.bright_cyan,
|
||||
["Ansi 15"] = term.bright_white,
|
||||
["Foreground"] = specs.Normal.fg,
|
||||
["Background"] = specs.Normal.bg,
|
||||
["Bold"] = term.bright_black,
|
||||
["Cursor"] = specs.Cursor.bg,
|
||||
["Cursor Text"] = specs.Cursor.fg,
|
||||
["Cursor Guide"] = specs.CursorLine.bg,
|
||||
Link = term[13],
|
||||
Selection = specs.Visual.bg,
|
||||
["Link"] = term.bright_blue,
|
||||
["Selection"] = specs.Visual.bg,
|
||||
["Selected Text"] = specs.Normal.fg,
|
||||
Badge = specs.Comment.fg,
|
||||
Tab = specs.Normal.bg,
|
||||
["Badge"] = specs.Comment.fg,
|
||||
["Tab"] = specs.Normal.bg,
|
||||
}
|
||||
|
||||
local template = start_template
|
||||
|
||||
@@ -9,7 +9,7 @@ run(
|
||||
author = "Michael Chris Lopez",
|
||||
license = "MIT",
|
||||
upstream = string.format("https://github.com/mcchrish/zenbones.nvim/raw/main/extras/kitty/%s.conf", name),
|
||||
url_color = term[13],
|
||||
url_color = term.bright_magenta,
|
||||
tab_active_bg = specs.Search.bg,
|
||||
tab_active_fg = colors.fg,
|
||||
tab_inactive_bg = specs.StatusLine.bg,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
local template = [[function! zenbones#generated#$name#load() abort
|
||||
$termcolors
|
||||
|
||||
$vimcolors
|
||||
|
||||
let s:italics = (&t_ZH != '' && &t_ZH != '[7m') || has('gui_running') || has('nvim')
|
||||
@@ -15,9 +16,28 @@ local function to_vim_autoload(colorscheme)
|
||||
local vimcolors, term, name = unpack(colorscheme)
|
||||
local termcolors = ""
|
||||
for i, v in ipairs(term) do
|
||||
termcolors = termcolors .. string.format("let g:terminal_color_%s = '%s'\n", (i - 1), v.hex)
|
||||
termcolors = termcolors .. string.format("let g:terminal_color_%s = '%s'\n", (i - 1), v)
|
||||
end
|
||||
|
||||
termcolors = table.concat({
|
||||
string.format("let g:terminal_color_0 = '%s'", term.black),
|
||||
string.format("let g:terminal_color_1 = '%s'", term.red),
|
||||
string.format("let g:terminal_color_2 = '%s'", term.green),
|
||||
string.format("let g:terminal_color_3 = '%s'", term.yellow),
|
||||
string.format("let g:terminal_color_4 = '%s'", term.blue),
|
||||
string.format("let g:terminal_color_5 = '%s'", term.magenta),
|
||||
string.format("let g:terminal_color_6 = '%s'", term.cyan),
|
||||
string.format("let g:terminal_color_7 = '%s'", term.white),
|
||||
string.format("let g:terminal_color_8 = '%s'", term.bright_black),
|
||||
string.format("let g:terminal_color_9 = '%s'", term.bright_red),
|
||||
string.format("let g:terminal_color_10 = '%s'", term.bright_green),
|
||||
string.format("let g:terminal_color_11 = '%s'", term.bright_yellow),
|
||||
string.format("let g:terminal_color_12 = '%s'", term.bright_blue),
|
||||
string.format("let g:terminal_color_13 = '%s'", term.bright_magenta),
|
||||
string.format("let g:terminal_color_14 = '%s'", term.bright_cyan),
|
||||
string.format("let g:terminal_color_15 = '%s'", term.bright_white),
|
||||
}, "\n")
|
||||
|
||||
local text = helpers.apply_template(template, {
|
||||
name = name,
|
||||
termcolors = termcolors,
|
||||
|
||||
@@ -3,30 +3,14 @@ local M = {}
|
||||
M.colorscheme_to_term_colors = function(colorscheme)
|
||||
local specs, _, term = unpack(colorscheme)
|
||||
local fg = specs.Normal.fg
|
||||
return {
|
||||
return vim.tbl_extend("keep", {
|
||||
fg = fg,
|
||||
bg = specs.Normal.bg,
|
||||
cursor_fg = specs.Cursor.fg,
|
||||
cursor_bg = specs.Cursor.bg,
|
||||
selection_bg = specs.Visual.bg,
|
||||
selection_fg = fg,
|
||||
black = term[1],
|
||||
red = term[2],
|
||||
green = term[3],
|
||||
yellow = term[4],
|
||||
blue = term[5],
|
||||
magenta = term[6],
|
||||
cyan = term[7],
|
||||
white = term[8],
|
||||
bright_black = term[9],
|
||||
bright_red = term[10],
|
||||
bright_green = term[11],
|
||||
bright_yellow = term[12],
|
||||
bright_blue = term[13],
|
||||
bright_magenta = term[14],
|
||||
bright_cyan = term[15],
|
||||
bright_white = term[16],
|
||||
}
|
||||
}, term)
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user