From 81209f4fec2409036b775c624a5b3e28fd7be272 Mon Sep 17 00:00:00 2001 From: siduck Date: Sat, 14 May 2022 12:07:55 +0530 Subject: [PATCH] polish one_light theme (#67) | fix bugged toggle btn --- lua/base46.lua | 8 +++- lua/chadlights.lua | 22 ++++++---- lua/hl_themes/one_light.lua | 77 ++++++++++++++++++++++++---------- lua/integrations/nvchad.lua | 16 +++++-- lua/integrations/telescope.lua | 2 +- 5 files changed, 90 insertions(+), 35 deletions(-) diff --git a/lua/base46.lua b/lua/base46.lua index 1b857ca..8fd4f9f 100644 --- a/lua/base46.lua +++ b/lua/base46.lua @@ -67,14 +67,18 @@ M.toggle_theme = function() local theme1 = themes[1] local theme2 = themes[2] - if vim.g.nvchad_theme == theme1 then + if vim.g.toggle_theme_icon == "  " then + vim.g.toggle_theme_icon = "  " + else vim.g.toggle_theme_icon = "  " + end + + if vim.g.nvchad_theme == theme1 then vim.g.nvchad_theme = theme2 require("nvchad").reload_theme() require("nvchad").change_theme(theme1, theme2) elseif vim.g.nvchad_theme == theme2 then - vim.g.toggle_theme_icon = "  " vim.g.nvchad_theme = theme1 require("nvchad").reload_theme() diff --git a/lua/chadlights.lua b/lua/chadlights.lua index de3adcb..0b6bcb2 100644 --- a/lua/chadlights.lua +++ b/lua/chadlights.lua @@ -1,11 +1,11 @@ --- returns a huge table of all highlight groups & their colors +local ui = nvchad.load_config().ui local merge_tb = require("base46").merge_tb local highlights = {} local hl_dir = vim.fn.stdpath "data" .. "/site/pack/packer/opt/base46/lua/integrations" --- push all file names in hl_dir to a table +-- push hl_dir file names to table local hl_files = require("plenary.scandir").scan_dir(hl_dir, {}) for _, file in ipairs(hl_files) do @@ -19,16 +19,22 @@ end -- term colors require "term_hl" +-- polish theme specific highlights +local theme = require("hl_themes." .. ui.theme) + +if theme.polish_hl then + highlights = merge_tb(highlights, theme.polish_hl) +end + -- override user highlights if there are any -local user_highlights = nvchad.load_config().ui.hl_override -highlights = merge_tb(highlights, user_highlights) +if ui.hl_override then + local user_highlights = nvchad.load_config().ui.hl_override + highlights = merge_tb(highlights, user_highlights) +end -- local set_transparent = nvchad.load_config().ui.transparency -local ui = nvchad.load_config().ui - if ui.transparency then - local glassy_hls = require "nv_glassy" - highlights = merge_tb(highlights, glassy_hls) + highlights = merge_tb(highlights, require "nv_glassy") end -- finally set all highlights :D diff --git a/lua/hl_themes/one_light.lua b/lua/hl_themes/one_light.lua index 4e3386d..72ecd2f 100644 --- a/lua/hl_themes/one_light.lua +++ b/lua/hl_themes/one_light.lua @@ -2,34 +2,34 @@ local M = {} M.base_30 = { white = "#54555b", - darker_black = "#f5f5f5", + darker_black = "#efeff0", black = "#fafafa", -- nvim bg - black2 = "#f1f1f1", - one_bg = "#f0f0f0", -- real bg of onedark - one_bg2 = "#ececec", - one_bg3 = "#e7e7e7", - grey = "#cbcbcb", - grey_fg = "#c6c6c6", - grey_fg2 = "#b7b7b7", - light_grey = "#b7b7b7", - red = "#e6676e", + black2 = "#EAEAEB", + one_bg = "#dadadb", -- real bg of onedark + one_bg2 = "#d4d4d5", + one_bg3 = "#cccccd", + grey = "#b7b7b8", + grey_fg = "#b0b0b1", + grey_fg2 = "#a9a9aa", + light_grey = "#a2a2a3", + red = "#d84a3d", baby_pink = "#F07178", pink = "#ff75a0", line = "#e9e9e9", -- for lines like vertsplit - green = "#7b90c7", + green = "#50a14f", vibrant_green = "#7eca9c", - nord_blue = "#5e5f65", - blue = "#28a2f4", - yellow = "#7e7e7e", + nord_blue = "#428bab", + blue = "#4078f2", + yellow = "#c18401", sun = "#dea95f", purple = "#a28dcd", dark_purple = "#8e79b9", teal = "#519ABA", orange = "#FF6A00", - cyan = "#a3b8ef", - statusline_bg = "#f0f0f0", - lightbg = "#d6d6d6", - lightbg2 = "#5e5f65", + cyan = "#0b8ec6", + statusline_bg = "#ececec", + lightbg = "#d3d3d3", + lightbg2 = "#54555b", pmenu_bg = "#5e5f65", folder_bg = "#6C6C6C", } @@ -43,11 +43,11 @@ M.base_16 = { base05 = "#383a42", base06 = "#202227", base07 = "#090a0b", - base08 = "#ca1243", - base09 = "#d75f00", + base08 = "#d84a3d", + base09 = "#a626a4", base0A = "#c18401", base0B = "#50a14f", - base0C = "#0184bc", + base0C = "#0070a8", base0D = "#4078f2", base0E = "#a626a4", base0F = "#986801", @@ -55,4 +55,39 @@ M.base_16 = { M = require("base46").override_theme(M, "one_light") +M.polish_hl = { + WhichKeyDesc = { + fg = M.base_30.white, + }, + + WhichKey = { + fg = M.base_30.white, + }, + + TelescopePromptPrefix = { + fg = M.base_30.white, + }, + + TelescopeSelection = { + bg = M.base_30.one_bg, + fg = M.base_30.white, + }, + + TSPunctBracket = { + fg = M.base_30.nord_blue, + }, + + NormalFloat = { + bg = M.base_30.black, + }, + + FloatBorder = { + fg = M.base_16.base05, + }, + + DiffAdd = { + fg = M.base_16.base05, + }, +} + return M diff --git a/lua/integrations/nvchad.lua b/lua/integrations/nvchad.lua index 1c6f1e2..42cb746 100644 --- a/lua/integrations/nvchad.lua +++ b/lua/integrations/nvchad.lua @@ -18,7 +18,7 @@ local yellow = colors.yellow local orange = colors.orange -- highlight groups & colors -local defaults = { +return { Comment = { fg = grey_fg }, @@ -91,6 +91,16 @@ local defaults = { WhichKeyDesc = { fg = red }, WhichKeyGroup = { fg = green }, WhichKeyValue = { fg = green }, -} -return defaults + -- packer + packerPackageName = { fg = red }, + + -- vim-matchup + MatchWord = { + fg = black, + bg = white, + }, + + MatchParen = { link = "MatchWord" }, + MatchParenCur = { link = "MatchWord" }, +} diff --git a/lua/integrations/telescope.lua b/lua/integrations/telescope.lua index 5466061..e81373c 100644 --- a/lua/integrations/telescope.lua +++ b/lua/integrations/telescope.lua @@ -39,5 +39,5 @@ return { bg = colors.darker_black, }, - TelescopeSelection = { bg = colors.black2 }, + TelescopeSelection = { bg = colors.one_bg, fg = colors.white }, }