Something went wrong. Try again.
A minimal colorscheme for neovim and more
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879---@param p nor.Palette---@return tablelocal function build(p) return { primary = p.blue.fg, secondary = p.red.mid, accent = p.orange.fg, error = p.error, warning = p.warning, success = p.success, info = p.info, text = p.fg, textMuted = p.fg_dim, background = p.bg, backgroundPanel = p.bg_dim, backgroundElement = p.bg_dim, border = p.bg_alt, borderActive = p.fg_hint, borderSubtle = p.bg_alt, diffAdded = p.green.fg, diffRemoved = p.red.fg, diffContext = p.fg_dim, diffHunkHeader = p.fg_dim, diffHighlightAdded = p.green.fg_intense, diffHighlightRemoved = p.red.fg_intense, diffAddedBg = p.green.bg, diffRemovedBg = p.red.bg, diffContextBg = p.bg_dim, diffLineNumber = p.fg_hint, diffAddedLineNumberBg = p.green.bg, diffRemovedLineNumberBg = p.red.bg, markdownText = p.fg, markdownHeading = p.red.mid, markdownLink = p.fg_alt, markdownLinkText = p.blue.fg, markdownCode = p.blue.fg, markdownBlockQuote = p.fg_dim, markdownEmph = p.fg, markdownStrong = p.fg, markdownHorizontalRule = p.fg_dim, markdownListItem = p.fg_alt, markdownListEnumeration = p.fg_alt, markdownImage = p.fg_alt, markdownImageText = p.blue.fg, markdownCodeBlock = p.blue.fg, syntaxComment = p.fg_dim, syntaxKeyword = p.red.mid, syntaxFunction = p.fg, syntaxVariable = p.fg_alt, syntaxString = p.red.fg, syntaxNumber = p.blue.fg, syntaxType = p.blue.fg, syntaxOperator = p.fg, syntaxPunctuation = p.fg_dim, }end
---@param dark nor.Palette---@param light nor.Palette---@return stringreturn function(dark, light) local theme = { ["$schema"] = "https://opencode.ai/theme.json", theme = {}, }
local dark_t = build(dark) local light_t = build(light)
for k, _ in pairs(dark_t) do theme.theme[k] = { dark = dark_t[k], light = light_t[k] } end
local json = vim.json.encode(theme) local ok, result = pcall(vim.fn.system, { "jq", "--indent", "2", "--sort-keys" }, json) if ok and result and vim.v.shell_error == 0 then return result end return jsonend