craftzdog.solarized-osaka.nvim/lua/solarized-osaka/theme.lua
Takuya Matsuyama 0df74ef0ed refactor(colors): Source every color from the palette and drop darken
Point the last computed colors at real tokens so nothing is derived by
blending anymore:

- barbar inactive labels take the new 600 tier, which reads dimmer than
  the 500 accent and, unlike 700, still brightens under the vivid style
- notify borders take the 900 tier, and the debug border takes base02
- black was a blend of the background toward pure black, a value that
  appeared nowhere in the palette; it is base04, so replace it outright
- border was aliased to black, leaving it invisible against the
  background in the dark style; it is now base02, matching WinSeparator

With no callers left, darken and blend go, and with them the mutable
util.bg they relied on -- a shared global whose value depended on which
style had been resolved last.

Every highlight group is unchanged by the black removal. The barbar and
notify groups do shift slightly, since a token can never reproduce a
blend toward the background exactly; they were chosen to read correctly
rather than to match the old values.

Light gains from this: black resolved to a muddy #cac4b5 that measured
1.85:1 on statusline mode chips, and base04 lifts that to 3.21:1. The
same change makes terminal color0 white in the light style, completing
an inversion that already had color7 resolving to a dark value.
2026-08-11 15:38:54 +09:00

64 lines
1.4 KiB
Lua

local Util = require("solarized-osaka.util")
local M = {}
function M.setup()
local colors = require("solarized-osaka.colors").setup()
local opts = require("solarized-osaka.config")
local groups = require("solarized-osaka.groups").setup(colors, opts.options)
if vim.g.loaded_lightline then
vim.g.lightline = { colorscheme = "solarized_osaka" }
end
if vim.g.colors_name then
vim.cmd("hi clear")
end
vim.o.termguicolors = true
vim.g.colors_name = "solarized-osaka"
for group, hl in pairs(groups) do
hl = type(hl) == "string" and { link = hl } or hl
vim.api.nvim_set_hl(0, group, hl)
end
if opts.options.terminal_colors then
M.terminal(colors)
end
return colors, groups, opts
end
---@param colors ColorScheme
function M.terminal(colors)
-- dark
vim.g.terminal_color_0 = colors.base04
vim.g.terminal_color_8 = colors.base04
-- light
vim.g.terminal_color_7 = colors.fg
vim.g.terminal_color_15 = colors.fg
-- colors
vim.g.terminal_color_1 = colors.red
vim.g.terminal_color_9 = colors.red
vim.g.terminal_color_2 = colors.green
vim.g.terminal_color_10 = colors.green
vim.g.terminal_color_3 = colors.yellow
vim.g.terminal_color_11 = colors.yellow
vim.g.terminal_color_4 = colors.blue
vim.g.terminal_color_12 = colors.blue
vim.g.terminal_color_5 = colors.magenta
vim.g.terminal_color_13 = colors.magenta
vim.g.terminal_color_6 = colors.cyan
vim.g.terminal_color_14 = colors.cyan
end
return M