From b6641e879060aff38b6e74088186dfcfb9cf33cc Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Wed, 8 Jan 2025 12:42:46 -0800 Subject: [PATCH] Refactor color names to match ANSI names --- lua/lush_theme/wombat_classic.lua | 16 ++++----- lua/lush_theme/wombat_lush.lua | 18 +++++----- lua/lush_theme/wombat_lush_colors.lua | 51 ++++++++++++++++++--------- 3 files changed, 50 insertions(+), 35 deletions(-) diff --git a/lua/lush_theme/wombat_classic.lua b/lua/lush_theme/wombat_classic.lua index 962237b..19ca579 100644 --- a/lua/lush_theme/wombat_classic.lua +++ b/lua/lush_theme/wombat_classic.lua @@ -99,8 +99,8 @@ local theme = lush(function() Normal({ bg = c.dark_bg_256mod, fg = c.dark_fg_256mod }), -- normal text -- NormalFloat { }, -- Normal text in floating windows. -- NormalNC { }, -- normal text in non-current windows - Pmenu({ fg = c.lightyellow, bg = c.grey_5 }), -- Popup menu: normal item. - PmenuSel({ fg = c.green.readable(), bg = c.green }), -- Popup menu: selected item. + Pmenu({ fg = c.bright_yellow, bg = c.grey_5 }), -- Popup menu: normal item. + PmenuSel({ fg = c.bright_green.readable(), bg = c.bright_green }), -- Popup menu: selected item. -- PmenuSbar { }, -- Popup menu: scrollbar. -- PmenuThumb { }, -- Popup menu: Thumb of the scrollbar. -- Question { }, -- |hit-enter| prompt and yes/no questions @@ -111,15 +111,15 @@ local theme = lush(function() -- SpellCap { }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise. -- SpellLocal { }, -- Word that is recognized by the spellchecker as one that is used in another region. |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. - StatusLine({ fg = c.lightyellow, bg = c.grey_5, gui = italic }), -- status line of current window + StatusLine({ fg = c.bright_yellow, bg = c.grey_5, gui = italic }), -- status line of current window StatusLineNC({ fg = c.grey_2, bg = StatusLine.bg }), -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. -- TabLine { }, -- tab pages line, not active tab page label -- TabLineFill { }, -- tab pages line, where there are no labels -- TabLineSel { }, -- tab pages line, active tab page label - Title({ fg = c.lightyellow, gui = "bold" }), -- titles for output from ":set all", ":autocmd" etc. + Title({ fg = c.bright_yellow, gui = "bold" }), -- titles for output from ":set all", ":autocmd" etc. Visual({ fg = c.grey_1, bg = c.grey_4 }), -- Visual mode selection VisualNOS({ fg = c.grey_1, bg = c.grey_5 }), -- Visual mode selection when vim is "Not Owning the Selection". - WarningMsg({ fg = c.red }), -- warning messages + WarningMsg({ fg = c.bright_red }), -- warning messages -- Whitespace { }, -- "nbsp", "space", "tab" and "trail" in 'listchars' -- WildMenu { }, -- current match in 'wildmenu' completion @@ -130,14 +130,14 @@ local theme = lush(function() -- Uncomment and edit if you want more specific syntax highlighting. Constant({ fg = c.orange }), -- (preferred) any constant - String({ fg = c.bright_green, gui = italic }), -- a string constant: "this is a string" + String({ fg = c.green, gui = italic }), -- a string constant: "this is a string" -- Character { }, -- a character constant: 'c', '\n' Number({ fg = c.orange }), -- a number constant: 234, 0xff -- Boolean { }, -- a boolean constant: TRUE, false -- Float { }, -- a floating point constant: 2.3e10 - Identifier({ fg = c.green }), -- (preferred) any variable name - Function({ fg = c.green }), -- function name (also: methods for classes) + Identifier({ fg = c.bright_green }), -- (preferred) any variable name + Function({ fg = c.bright_green }), -- function name (also: methods for classes) Statement({ fg = c.blue }), -- (preferred) any statement -- Conditional { }, -- if, then, else, endif, switch, etc. diff --git a/lua/lush_theme/wombat_lush.lua b/lua/lush_theme/wombat_lush.lua index 21b2047..e1ffd9d 100644 --- a/lua/lush_theme/wombat_lush.lua +++ b/lua/lush_theme/wombat_lush.lua @@ -43,10 +43,8 @@ -- `:lua require('lush').ify()` local lush = require("lush") -local hsl = lush.hsl local c = require("lush_theme.wombat_lush_colors").colors -local italic = require("lush_theme.wombat_lush_colors").italic local classic = require("lush_theme.wombat_classic") -- LSP/Linters mistakenly show `undefined global` errors in the spec, they may @@ -77,9 +75,9 @@ local theme = lush.extends({ classic }).with(function(injected_functions) -- CursorColumn { Cursor }, -- Screen-column at the cursor, when 'cursorcolumn' is set. -- CursorLine { bg = c.grey_6}, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set. -- Directory { }, -- directory names (and other special names in listings) - DiffAdd({ fg = c.darkgreen.readable(), bg = c.darkgreen }), -- diff mode: Added line |diff.txt| + DiffAdd({ fg = c.dark_green.readable(), bg = c.dark_green }), -- diff mode: Added line |diff.txt| DiffChange({ bg = c.violet }), -- diff mode: Changed line |diff.txt| - DiffDelete({ fg = c.darkred.readable(), bg = c.darkred }), -- diff mode: Deleted line |diff.txt| + DiffDelete({ fg = c.red.readable(), bg = c.red }), -- diff mode: Deleted line |diff.txt| DiffText({ fg = c.magenta.readable(), bg = c.magenta }), -- diff mode: Changed text within a changed line |diff.txt| -- EndOfBuffer { }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. -- TermCursor { }, -- cursor in a focused terminal @@ -104,7 +102,7 @@ local theme = lush.extends({ classic }).with(function(injected_functions) FloatBorder({ bg = NormalFloat.bg, fg = classic.Pmenu.fg }), -- float border -- NormalNC { }, -- normal text in non-current windows -- Pmenu { fg = c.light_yellow, bg = c.grey_5 }, -- Popup menu: normal item. - -- PmenuSel { fg = c.green.readable(), bg = c.green }, -- Popup menu: selected item. + -- PmenuSel { fg = c.bright_green.readable(), bg = c.green }, -- Popup menu: selected item. -- PmenuSbar { }, -- Popup menu: scrollbar. -- PmenuThumb { }, -- Popup menu: Thumb of the scrollbar. -- Question { }, -- |hit-enter| prompt and yes/no questions @@ -123,7 +121,7 @@ local theme = lush.extends({ classic }).with(function(injected_functions) -- Title { fg = c.light_yellow, gui = "bold" }, -- titles for output from ":set all", ":autocmd" etc. -- Visual { fg = c.grey_1, bg = c.grey_4 }, -- Visual mode selection -- VisualNOS { fg = c.grey_1, bg = c.grey_5 }, -- Visual mode selection when vim is "Not Owning the Selection". - -- WarningMsg { fg = c.red }, -- warning messages + -- WarningMsg { fg = c.bright_red }, -- warning messages -- Whitespace { }, -- "nbsp", "space", "tab" and "trail" in 'listchars' -- WildMenu { }, -- current match in 'wildmenu' completion @@ -134,10 +132,10 @@ local theme = lush.extends({ classic }).with(function(injected_functions) -- Uncomment and edit if you want more specific syntax highlighting. -- Constant { fg = c.orange }, -- (preferred) any constant - -- String { fg = c.bright_green, gui = italic }, -- a string constant: "this is a string" + -- String { fg = c.green, gui = italic }, -- a string constant: "this is a string" -- Character { }, -- a character constant: 'c', '\n' -- Number { fg = c.orange }, -- a number constant: 234, 0xff - Boolean({ fg = c.red }), -- a boolean constant: TRUE, false + Boolean({ fg = c.bright_red }), -- a boolean constant: TRUE, false Float({ classic.Number }), -- a floating point constant: 2.3e10 -- Identifier { classic.Identifier }, -- (preferred) any variable name @@ -283,8 +281,8 @@ local theme = lush.extends({ classic }).with(function(injected_functions) sym("@text")({ TSText }), -- cmp highlights - CmpItemAbbrDeprecated({ fg = c.green, gui = "strikethrough" }), - CmpItemAbbrMatch({ fg = c.green }), + CmpItemAbbrDeprecated({ fg = c.bright_green, gui = "strikethrough" }), + CmpItemAbbrMatch({ fg = c.bright_green }), CmpItemAbbrMatchFuzzy({ CmpItemAbbrMatch }), CmpItemKindVariable({ TSVariable }), CmpItemKindInterface({ TSType }), diff --git a/lua/lush_theme/wombat_lush_colors.lua b/lua/lush_theme/wombat_lush_colors.lua index 85aa5f2..403ef9d 100644 --- a/lua/lush_theme/wombat_lush_colors.lua +++ b/lua/lush_theme/wombat_lush_colors.lua @@ -12,29 +12,52 @@ local M = { local c = M.colors c.black = hsl("#000000") -c.red = hsl("#ff786c") -c.darkred = c.red.darken(c_step) -c.green = hsl("#bde97c") -- 256mod #cae982 -c.bright_green = hsl("#95e454") -c.darkgreen = c.green.darken(c_step) +c.red = hsl("#ff786c").darken(c_step) +c.green = hsl("#95e454") c.yellow = hsl("#efdeab") -c.lightyellow = hsl("#ffffd7") -c.darkyellow = c.yellow.darken(c_step) c.blue = hsl("#6eb9f8") -- 256mod #88b8f6 -c.darkblue = c.blue.darken(c_step) c.magenta = hsl("#ee87ff") -c.darkmagenta = c.magenta.darken(c_step) c.cyan = hsl("#90fdf8") -c.darkcyan = c.cyan.darken(c_step) c.white = hsl("#e4e0d7") +c.bright_black = hsl("#313131") +c.bright_red = hsl("#ff786c") +c.bright_green = hsl("#bde97c") -- 256mod #cae982 +c.bright_yellow = hsl("#ffffd7") +c.bright_blue = c.blue.brighten(c_step) +c.bright_magenta = c.magenta.brighten(c_step) +c.bright_cyan = c.cyan.brighten(c_step) +c.bright_white = hsl("#ffffff") + +-- Set some fg/bg colors +c.dark_fg = hsl("#e4e0d7") +c.dark_bg = hsl("#1e1e1e") +c.dark_fg_256mod = hsl("#e3e0d7") +c.dark_bg_256mod = hsl("#242424") + +c.cursor = hsl("#bbbbbb") +c.cursor_text = hsl("#ffffff") + +c.selection_background = hsl("#574b49") +c.selection_foreground = hsl("#c3c6ca") + +-- Add dark color variants not in pallet +c.dark_black = c.black.darken(c_step) +c.dark_red = c.red.darken(c_step) +c.dark_green = c.bright_green.darken(c_step) +c.dark_yellow = c.yellow.darken(c_step) +c.dark_blue = c.blue.darken(c_step) +c.dark_magenta = c.magenta.darken(c_step) +c.dark_cyan = c.cyan.darken(c_step) +c.dark_white = c.white.darken(c_step) + c.orange = hsl("#e5786d") c.darkorange = c.orange.darken(c_step) c.purple = hsl("#d787ff") c.violet = hsl("#b294bb") c.grey = hsl("#574b49") c.aqua = c.cyan -c.pink = c.red.lighten(c_step) +c.pink = c.bright_red.lighten(c_step) -- A few grey scales c.grey_1 = hsl("#c3c6ca") @@ -47,10 +70,4 @@ c.grey_6 = hsl("#32322f") -- Other colors c.error_red = hsl("#ff2026") --- Set some fg/bg colors -c.dark_fg = hsl("#e4e0d7") -c.dark_bg = hsl("#1e1e1e") -c.dark_fg_256mod = hsl("#e3e0d7") -c.dark_bg_256mod = hsl("#242424") - return M