Refactor theme colors and UI settings for improved visibility and consistency across components. Update README.

This commit is contained in:
Webhooked
2025-05-07 11:27:21 +02:00
parent 47074d196d
commit e5ae0533c5
5 changed files with 616 additions and 603 deletions
+1 -1
View File
@@ -210,7 +210,7 @@ require('kanso').setup({
}, },
all = { all = {
ui = { ui = {
bg_gutter = "none" cursor_line_nr_active_foreground = "#C4746E"
} }
} }
} }
+13 -13
View File
@@ -46,9 +46,9 @@ function M.setup(colors, config)
-- Folded Line used for closed folds. -- Folded Line used for closed folds.
Folded = { fg = theme.ui.special, bg = theme.ui.bg_p1 }, Folded = { fg = theme.ui.special, bg = theme.ui.bg_p1 },
-- FoldColumn 'foldcolumn' -- FoldColumn 'foldcolumn'
FoldColumn = { fg = theme.ui.nontext, bg = theme.ui.bg_gutter }, FoldColumn = { fg = theme.ui.nontext, bg = theme.ui.none },
-- SignColumn Column where |signs| are displayed. -- SignColumn Column where |signs| are displayed.
SignColumn = { fg = theme.ui.special, bg = theme.ui.bg_gutter }, SignColumn = { fg = theme.ui.special, bg = theme.ui.none },
-- IncSearch 'incsearch' highlighting; also used for the text replaced with ":s///c". -- IncSearch 'incsearch' highlighting; also used for the text replaced with ":s///c".
IncSearch = { fg = theme.ui.fg_reverse, bg = theme.diag.warning }, IncSearch = { fg = theme.ui.fg_reverse, bg = theme.diag.warning },
-- Substitute |:substitute| replacement text highlighting. -- Substitute |:substitute| replacement text highlighting.
@@ -74,7 +74,7 @@ function M.setup(colors, config)
-- NonText '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|. -- NonText '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
NonText = { fg = theme.ui.nontext }, NonText = { fg = theme.ui.nontext },
-- Normal Normal text. -- Normal Normal text.
Normal = { fg = theme.ui.fg, bg = not config.transparent and theme.ui.bg or "NONE" }, Normal = { fg = theme.ui.fg, bg = theme.ui.none },
-- NormalFloat Normal text in floating windows. -- NormalFloat Normal text in floating windows.
NormalFloat = { fg = theme.ui.float.fg, bg = theme.ui.float.bg }, NormalFloat = { fg = theme.ui.float.fg, bg = theme.ui.float.bg },
-- FloatBorder Border of floating windows. -- FloatBorder Border of floating windows.
@@ -118,15 +118,15 @@ function M.setup(colors, config)
-- SpellRare Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise. -- SpellRare Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
SpellRare = { undercurl = config.undercurl, underline = not config.undercurl, sp = theme.diag.warning }, SpellRare = { undercurl = config.undercurl, underline = not config.undercurl, sp = theme.diag.warning },
-- StatusLine Status line of current window. -- StatusLine Status line of current window.
StatusLine = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m3 }, StatusLine = { fg = theme.ui.fg_dim, bg = theme.ui.none },
-- StatusLineNC Status lines of not-current windows. Note: If this is equal to "StatusLine", Vim will use "^^^" in the status line of the current window. -- StatusLineNC Status lines of not-current windows. Note: If this is equal to "StatusLine", Vim will use "^^^" in the status line of the current window.
StatusLineNC = { fg = theme.ui.nontext, bg = theme.ui.bg_m3 }, StatusLineNC = { fg = theme.ui.nontext, bg = theme.ui.none },
-- TabLine Tab pages line, not active tab page label. -- TabLine Tab pages line, not active tab page label.
TabLine = { bg = theme.ui.bg_m3, fg = theme.ui.special }, TabLine = { bg = theme.ui.none, fg = theme.ui.special },
-- TabLineFill Tab pages line, where there are no labels. -- TabLineFill Tab pages line, where there are no labels.
TabLineFill = { bg = theme.ui.bg }, TabLineFill = { bg = theme.ui.none },
-- TabLineSel Tab pages line, active tab page label. -- TabLineSel Tab pages line, active tab page label.
TabLineSel = { fg = theme.ui.fg_dim, bg = theme.ui.bg_p1 }, TabLineSel = { fg = theme.ui.fg_dim, bg = not config.transparent and theme.ui.bg_p1 or "NONE", bold = true },
-- Title Titles for output from ":set all", ":autocmd" etc. -- Title Titles for output from ":set all", ":autocmd" etc.
Title = { fg = theme.syn.fun, bold = true }, Title = { fg = theme.syn.fun, bold = true },
-- Visual Visual mode selection. -- Visual Visual mode selection.
@@ -148,7 +148,7 @@ function M.setup(colors, config)
-- NormalSB = { link = "Normal" }, -- NormalSB = { link = "Normal" },
debugPC = { bg = theme.diff.delete }, debugPC = { bg = theme.diff.delete },
debugBreakpoint = { fg = theme.syn.special1, bg = theme.ui.bg_gutter }, debugBreakpoint = { fg = theme.syn.special1, bg = theme.ui.none },
LspReferenceText = { bg = theme.ui.bg_p2 }, LspReferenceText = { bg = theme.ui.bg_p2 },
LspReferenceRead = { link = "LspReferenceText" }, LspReferenceRead = { link = "LspReferenceText" },
@@ -167,10 +167,10 @@ function M.setup(colors, config)
DiagnosticFloatingHint = { fg = theme.diag.hint }, DiagnosticFloatingHint = { fg = theme.diag.hint },
DiagnosticFloatingOk = { fg = theme.diag.ok }, DiagnosticFloatingOk = { fg = theme.diag.ok },
DiagnosticSignError = { fg = theme.diag.error, bg = theme.ui.bg_gutter }, DiagnosticSignError = { fg = theme.diag.error, bg = theme.ui.none },
DiagnosticSignWarn = { fg = theme.diag.warning, bg = theme.ui.bg_gutter }, DiagnosticSignWarn = { fg = theme.diag.warning, bg = theme.ui.none },
DiagnosticSignInfo = { fg = theme.diag.info, bg = theme.ui.bg_gutter }, DiagnosticSignInfo = { fg = theme.diag.info, bg = theme.ui.none },
DiagnosticSignHint = { fg = theme.diag.hint, bg = theme.ui.bg_gutter }, DiagnosticSignHint = { fg = theme.diag.hint, bg = theme.ui.none },
DiagnosticVirtualTextError = { link = "DiagnosticError" }, DiagnosticVirtualTextError = { link = "DiagnosticError" },
DiagnosticVirtualTextWarn = { link = "DiagnosticWarn" }, DiagnosticVirtualTextWarn = { link = "DiagnosticWarn" },
+31 -23
View File
@@ -5,6 +5,7 @@ local M = {}
function M.setup(colors, config) function M.setup(colors, config)
config = config or require("kanso").config config = config or require("kanso").config
local theme = colors.theme local theme = colors.theme
return { return {
-- Neovcs -- Neovcs
-- NeovcsBranch = {}, -- NeovcsBranch = {},
@@ -21,9 +22,9 @@ function M.setup(colors, config)
-- vcsSignsDeleteLn = { bg = theme.diff.delete }, -- vcsSignsDeleteLn = { bg = theme.diff.delete },
-- Gitsigns -- Gitsigns
GitSignsAdd = { fg = theme.vcs.added, bg = theme.ui.bg_gutter }, GitSignsAdd = { fg = theme.vcs.added, bg = theme.ui.none },
GitSignsChange = { fg = theme.vcs.changed, bg = theme.ui.bg_gutter }, GitSignsChange = { fg = theme.vcs.changed, bg = theme.ui.none },
GitSignsDelete = { fg = theme.vcs.removed, bg = theme.ui.bg_gutter }, GitSignsDelete = { fg = theme.vcs.removed, bg = theme.ui.none },
-- Neogit -- Neogit
NeogitDiffContextHighlight = { bg = theme.diff.change }, --[[ guibg=#333333 guifg=#b2b2b2 ]] NeogitDiffContextHighlight = { bg = theme.diff.change }, --[[ guibg=#333333 guifg=#b2b2b2 ]]
NeogitHunkHeader = { fg = theme.syn.fun }, --[[ guifg=#cccccc guibg=#404040 ]] NeogitHunkHeader = { fg = theme.syn.fun }, --[[ guifg=#cccccc guibg=#404040 ]]
@@ -32,7 +33,7 @@ function M.setup(colors, config)
NeogitDiffDeleteHighlight = { bg = theme.diff.delete }, NeogitDiffDeleteHighlight = { bg = theme.diff.delete },
-- TreeSitter Extensions -- TreeSitter Extensions
TreesitterContext = { link = "Folded" }, TreesitterContext = { link = "Folded" },
TreesitterContextLineNumber = { fg = theme.ui.special, bg = theme.ui.bg_gutter }, TreesitterContextLineNumber = { fg = theme.ui.special, bg = theme.ui.none },
-- Telescope -- Telescope
TelescopeBorder = { fg = theme.ui.float.fg_border, bg = theme.ui.bg }, TelescopeBorder = { fg = theme.ui.float.fg_border, bg = theme.ui.bg },
TelescopeTitle = { fg = theme.ui.special }, TelescopeTitle = { fg = theme.ui.special },
@@ -61,10 +62,10 @@ function M.setup(colors, config)
NvimTreeWinSeparator = { link = "WinSeparator" }, NvimTreeWinSeparator = { link = "WinSeparator" },
NvimTreeWindowPicker = { bg = theme.ui.bg_m1, fg = theme.syn.special1, bold = true }, NvimTreeWindowPicker = { bg = theme.ui.bg_m1, fg = theme.syn.special1, bold = true },
-- NeoTree -- NeoTree
NeoTreeTabInactive = { link = "TabLine" }, NeoTreeTabInactive = { fg = theme.ui.special, bg = config.transparent and "NONE" or theme.ui.bg },
NeoTreeTabActive = { link = "TabLineSel" }, NeoTreeTabActive = { fg = theme.ui.fg_dim, bg = config.transparent and "NONE" or theme.ui.bg_p1, bold = true },
NeoTreeTabSeparatorInactive = { link = "NeoTreeTabInactive" }, NeoTreeTabSeparatorInactive = { fg = theme.ui.special, bg = config.transparent and "NONE" or theme.ui.bg },
NeoTreeTabSeparatorActive = { link = "NeoTreeTabActive" }, NeoTreeTabSeparatorActive = { fg = theme.ui.fg_dim, bg = config.transparent and "NONE" or theme.ui.bg_p1 },
NeoTreeRootName = { fg = theme.syn.identifier, bold = true }, NeoTreeRootName = { fg = theme.syn.identifier, bold = true },
NeoTreeModified = { link = "String" }, NeoTreeModified = { link = "String" },
NeoTreeGitModified = { fg = theme.vcs.changed }, NeoTreeGitModified = { fg = theme.vcs.changed },
@@ -232,14 +233,20 @@ function M.setup(colors, config)
BlinkCmpKindCopilot = { link = "String" }, BlinkCmpKindCopilot = { link = "String" },
-- IndentBlankline -- IndentBlankline
IndentBlanklineChar = { fg = theme.ui.whitespace }, IndentBlanklineChar = { fg = theme.ui.indent_line, nocombine = true },
IndentBlanklineSpaceChar = { fg = theme.ui.whitespace }, IndentBlanklineSpaceChar = { fg = theme.ui.indent_line, nocombine = true },
IndentBlanklineSpaceCharBlankline = { fg = theme.ui.whitespace }, IndentBlanklineSpaceCharBlankline = { fg = theme.ui.indent_line, nocombine = true },
IndentBlanklineContextChar = { fg = theme.ui.special }, IndentBlanklineContextChar = { fg = theme.ui.active_indent_line, nocombine = true },
IndentBlanklineContextStart = { sp = theme.ui.special, underline = true }, IndentBlanklineContextStart = { sp = theme.ui.active_indent_line, underline = true, nocombine = true },
IblIndent = { fg = theme.ui.whitespace }, IblIndent = { fg = theme.ui.indent_line, nocombine = true },
IblWhitespace = { fg = theme.ui.whitespace }, IblWhitespace = { fg = theme.ui.indent_line, nocombine = true },
IblScope = { fg = theme.ui.special }, IblScope = { fg = theme.ui.active_indent_line, nocombine = true },
-- Other indent plugins
IndentLine = { fg = theme.ui.indent_line, nocombine = true },
Indent = { fg = theme.ui.indent_line, nocombine = true },
IndentGuide = { fg = theme.ui.indent_line, nocombine = true },
IndentGuidesOdd = { fg = theme.ui.indent_line, nocombine = true },
IndentGuidesEven = { fg = theme.ui.indent_line, nocombine = true },
-- Lazy -- Lazy
LazyProgressTodo = { fg = theme.ui.nontext }, LazyProgressTodo = { fg = theme.ui.nontext },
@@ -333,9 +340,9 @@ function M.setup(colors, config)
MiniDepsTitleSame = { link = "DiffText" }, MiniDepsTitleSame = { link = "DiffText" },
MiniDepsTitleUpdate = { link = "DiffAdd" }, MiniDepsTitleUpdate = { link = "DiffAdd" },
MiniDiffSignAdd = { fg = theme.vcs.added, bg = theme.ui.bg_gutter }, MiniDiffSignAdd = { fg = theme.vcs.added, bg = theme.ui.none },
MiniDiffSignChange = { fg = theme.vcs.changed, bg = theme.ui.bg_gutter }, MiniDiffSignChange = { fg = theme.vcs.changed, bg = theme.ui.none },
MiniDiffSignDelete = { fg = theme.vcs.removed, bg = theme.ui.bg_gutter }, MiniDiffSignDelete = { fg = theme.vcs.removed, bg = theme.ui.none },
MiniDiffOverAdd = { link = "DiffAdd" }, MiniDiffOverAdd = { link = "DiffAdd" },
MiniDiffOverChange = { link = "DiffText" }, MiniDiffOverChange = { link = "DiffText" },
MiniDiffOverContext = { link = "DiffChange" }, MiniDiffOverContext = { link = "DiffChange" },
@@ -458,16 +465,17 @@ function M.setup(colors, config)
SnacksPicker = { bg = theme.ui.bg }, SnacksPicker = { bg = theme.ui.bg },
SnacksPickerTitle = { fg = theme.ui.fg, bg = theme.ui.bg }, SnacksPickerTitle = { fg = theme.ui.fg, bg = theme.ui.bg },
SnacksPickerBorder = { fg = theme.ui.bg }, SnacksPickerBorder = { fg = theme.ui.none, bg = theme.ui.none },
SnacksPickerNormal = { fg = theme.ui.fg, bg = theme.ui.bg }, SnacksPickerNormal = { fg = theme.ui.fg, bg = theme.ui.bg },
SnacksPickerMatch = { fg = theme.ui.fg }, SnacksPickerMatch = { fg = theme.ui.fg },
SnacksPickerCursor = { fg = theme.ui.bg, bg = theme.ui.bg }, SnacksPickerCursor = { fg = theme.ui.bg, bg = theme.ui.bg },
SnacksPickerPrompt = { fg = theme.ui.fg }, SnacksPickerPrompt = { fg = theme.ui.fg },
SnacksPickerDim = { fg = theme.ui.fg_dim }, SnacksPickerDim = { fg = theme.ui.fg_dim },
SnacksInputIcon = { fg = theme.ui.fg, bg = theme.ui.bg }, SnacksInputIcon = { fg = theme.ui.fg, bg = theme.ui.bg },
SnacksIndent = { fg = theme.ui.bg_gutter, bg = theme.ui.bg }, SnacksIndent = { fg = theme.ui.indent_line, nocombine = true },
SnacksIndentScope = { fg = theme.ui.bg, bg = theme.ui.bg }, SnacksIndentChunk = { fg = theme.ui.active_indent_line, nocombine = true },
SnacksPickerInputBorder = { fg = theme.ui.bg, bg = theme.ui.bg }, SnacksIndentScope = { fg = theme.ui.active_indent_line, nocombine = true },
SnacksPickerInputBorder = { fg = theme.ui.float.bg_border, bg = theme.ui.bg },
SnacksPickerInputTitle = { fg = theme.ui.bg, bg = theme.ui.bg }, SnacksPickerInputTitle = { fg = theme.ui.bg, bg = theme.ui.bg },
SnacksPickerBoxTitle = { fg = theme.ui.bg, bg = theme.ui.bg }, SnacksPickerBoxTitle = { fg = theme.ui.bg, bg = theme.ui.bg },
SnacksPickerSelected = { fg = theme.ui.bg }, SnacksPickerSelected = { fg = theme.ui.bg },
+14 -9
View File
@@ -56,6 +56,8 @@ local c = require("kanso.lib.color")
---@field bg_p2 ColorSpec Lighter background Cursor{Line,Column}, TabLineSel (Selected Items) ---@field bg_p2 ColorSpec Lighter background Cursor{Line,Column}, TabLineSel (Selected Items)
---@field bg_gutter ColorSpec {Sign,Fold}Column, LineNr ---@field bg_gutter ColorSpec {Sign,Fold}Column, LineNr
---@field special ColorSpec SpecialKey ---@field special ColorSpec SpecialKey
---@field indent_line ColorSpec IndentLine
---@field active_indent_line ColorSpec IndentLine
---@field nontext ColorSpec LineNr, NonText ---@field nontext ColorSpec LineNr, NonText
---@field whitespace ColorSpec Whitespace ---@field whitespace ColorSpec Whitespace
---@field bg_search ColorSpec ---@field bg_search ColorSpec
@@ -100,7 +102,6 @@ return {
fg_reverse = palette.zenBlue1, fg_reverse = palette.zenBlue1,
bg_dim = palette.zen0, bg_dim = palette.zen0,
bg_gutter = palette.zen0,
bg_m3 = palette.zen0, bg_m3 = palette.zen0,
bg_m2 = palette.zen0, bg_m2 = palette.zen0,
@@ -110,7 +111,9 @@ return {
bg_p2 = palette.zen2, bg_p2 = palette.zen2,
special = palette.inkGray3, special = palette.inkGray3,
whitespace = palette.inkAsh, indent_line = palette.inkBlack2,
active_indent_line = palette.inkBlack3,
whitespace = palette.inkBlack0,
nontext = palette.inkAsh, nontext = palette.inkAsh,
bg_visual = palette.inkBlack2, bg_visual = palette.inkBlack2,
@@ -133,7 +136,7 @@ return {
float = { float = {
fg = palette.oldWhite, fg = palette.oldWhite,
bg = palette.zen0, bg = palette.zen0,
fg_border = palette.zen3, fg_border = palette.zen2,
bg_border = palette.zen0, bg_border = palette.zen0,
}, },
}, },
@@ -208,7 +211,6 @@ return {
fg_reverse = palette.zenBlue1, fg_reverse = palette.zenBlue1,
bg_dim = palette.inkBlack0, bg_dim = palette.inkBlack0,
bg_gutter = palette.inkBlack0,
bg_m3 = palette.inkBlack0, bg_m3 = palette.inkBlack0,
bg_m2 = palette.inkBlack0, bg_m2 = palette.inkBlack0,
@@ -218,7 +220,9 @@ return {
bg_p2 = palette.inkBlack2, bg_p2 = palette.inkBlack2,
special = palette.inkGray3, special = palette.inkGray3,
whitespace = palette.inkAsh, indent_line = palette.inkBlack2,
active_indent_line = palette.inkBlack3,
whitespace = palette.inkBlack0,
nontext = palette.inkAsh, nontext = palette.inkAsh,
bg_visual = palette.inkBlack3, bg_visual = palette.inkBlack3,
@@ -241,7 +245,7 @@ return {
float = { float = {
fg = palette.oldWhite, fg = palette.oldWhite,
bg = palette.inkBlack0, bg = palette.inkBlack0,
fg_border = palette.inkBlack3, fg_border = palette.inkBlack2,
bg_border = palette.inkBlack0, bg_border = palette.inkBlack0,
}, },
}, },
@@ -316,7 +320,6 @@ return {
fg_reverse = palette.pearlGray, fg_reverse = palette.pearlGray,
bg_dim = palette.pearlWhite0, bg_dim = palette.pearlWhite0,
bg_gutter = palette.pearlWhite0,
bg_m3 = palette.pearlWhite0, bg_m3 = palette.pearlWhite0,
bg_m2 = palette.pearlWhite0, bg_m2 = palette.pearlWhite0,
@@ -326,8 +329,10 @@ return {
bg_p2 = palette.pearlWhite1, bg_p2 = palette.pearlWhite1,
nontext = palette.pearlViolet1, nontext = palette.pearlViolet1,
whitespace = palette.pearlViolet1, whitespace = palette.pearlWhite0,
special = palette.pearlViolet2, special = palette.pearlViolet2,
indent_line = palette.pearlWhite1,
active_indent_line = palette.pearlWhite2,
bg_visual = palette.pearlWhite2, bg_visual = palette.pearlWhite2,
bg_search = palette.pearlBlue2, bg_search = palette.pearlBlue2,
@@ -348,7 +353,7 @@ return {
float = { float = {
fg = palette.pearlInk2, fg = palette.pearlInk2,
bg = palette.pearlWhite0, bg = palette.pearlWhite0,
fg_border = palette.pearlGray2, fg_border = palette.pearlWhite2,
bg_border = palette.pearlWhite0, bg_border = palette.pearlWhite0,
}, },
}, },
+9 -9
View File
@@ -4,34 +4,34 @@ local kanso = {}
kanso.normal = { kanso.normal = {
a = { bg = theme.syn.fun, fg = theme.ui.bg }, a = { bg = theme.syn.fun, fg = theme.ui.bg },
b = { bg = theme.diff.change, fg = theme.syn.fun }, b = { bg = theme.ui.none, fg = theme.syn.fun },
c = { bg = theme.ui.bg, fg = theme.ui.fg }, c = { bg = theme.ui.none, fg = theme.ui.fg },
} }
kanso.insert = { kanso.insert = {
a = { bg = theme.diag.ok, fg = theme.ui.bg }, a = { bg = theme.diag.ok, fg = theme.ui.bg },
b = { bg = theme.ui.bg, fg = theme.diag.ok }, b = { bg = theme.ui.none, fg = theme.diag.ok },
} }
kanso.command = { kanso.command = {
a = { bg = theme.syn.operator, fg = theme.ui.bg }, a = { bg = theme.syn.operator, fg = theme.ui.bg },
b = { bg = theme.ui.bg, fg = theme.syn.operator }, b = { bg = theme.ui.none, fg = theme.syn.operator },
} }
kanso.visual = { kanso.visual = {
a = { bg = theme.syn.keyword, fg = theme.ui.bg }, a = { bg = theme.syn.keyword, fg = theme.ui.bg },
b = { bg = theme.ui.bg, fg = theme.syn.keyword }, b = { bg = theme.ui.none, fg = theme.syn.keyword },
} }
kanso.replace = { kanso.replace = {
a = { bg = theme.syn.constant, fg = theme.ui.bg }, a = { bg = theme.syn.constant, fg = theme.ui.bg },
b = { bg = theme.ui.bg, fg = theme.syn.constant }, b = { bg = theme.ui.none, fg = theme.syn.constant },
} }
kanso.inactive = { kanso.inactive = {
a = { bg = theme.ui.bg, fg = theme.ui.fg_dim }, a = { bg = theme.ui.none, fg = theme.ui.fg_dim },
b = { bg = theme.ui.bg, fg = theme.ui.fg_dim }, b = { bg = theme.ui.none, fg = theme.ui.fg_dim },
c = { bg = theme.ui.bg, fg = theme.ui.fg_dim }, c = { bg = theme.ui.none, fg = theme.ui.fg_dim },
} }
if vim.g.kanso_lualine_bold then if vim.g.kanso_lualine_bold then