From a70eef2af24f804cc017bb1b03ee238b033bffae Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 27 Sep 2025 01:29:24 +0200 Subject: Add themes --- lua/no-clown-fiesta/groups/blink.lua | 4 +- lua/no-clown-fiesta/groups/diffview.lua | 8 +-- lua/no-clown-fiesta/groups/highlights.lua | 26 ++++---- lua/no-clown-fiesta/groups/lazy.lua | 2 +- lua/no-clown-fiesta/groups/lir.lua | 2 +- lua/no-clown-fiesta/groups/nvim-tree.lua | 6 +- lua/no-clown-fiesta/groups/treesitter.lua | 40 +++++------ lua/no-clown-fiesta/init.lua | 7 +- lua/no-clown-fiesta/palette.lua | 37 ----------- lua/no-clown-fiesta/palettes.lua | 106 ++++++++++++++++++++++++++++++ lua/no-clown-fiesta/settings.lua | 1 + 11 files changed, 154 insertions(+), 85 deletions(-) delete mode 100644 lua/no-clown-fiesta/palette.lua create mode 100644 lua/no-clown-fiesta/palettes.lua (limited to 'lua/no-clown-fiesta') diff --git a/lua/no-clown-fiesta/groups/blink.lua b/lua/no-clown-fiesta/groups/blink.lua index 1f2b7bb..d2fb080 100644 --- a/lua/no-clown-fiesta/groups/blink.lua +++ b/lua/no-clown-fiesta/groups/blink.lua @@ -3,9 +3,9 @@ local M = {} function M.highlight(palette, _) return { BlinkCmpMenu = { fg = palette.medium_gray }, - BlinkCmpMenuBorder = { fg = palette.white }, + BlinkCmpMenuBorder = { fg = palette.fg }, BlinkCmpMenuSelection = { bg = palette.accent }, - BlinkCmpLabel = { fg = palette.white }, + BlinkCmpLabel = { fg = palette.fg }, BlinkCmpLabelMatch = { fg = palette.orange }, BlinkCmpLabelDetail = { fg = palette.medium_gray }, BlinkCmpLabelDeprecated = { fg = palette.medium_gray, strikethrough = true }, diff --git a/lua/no-clown-fiesta/groups/diffview.lua b/lua/no-clown-fiesta/groups/diffview.lua index f186b6b..3a37f83 100644 --- a/lua/no-clown-fiesta/groups/diffview.lua +++ b/lua/no-clown-fiesta/groups/diffview.lua @@ -1,10 +1,10 @@ local M = {} function M.highlight(palette, opts) - return { - DiffviewFilePanelInsertions = { fg = palette.sign_add, bold = true }, - DiffviewFilePanelDeletions = { fg = palette.sign_delete, bold = true }, - } + return { + DiffviewFilePanelInsertions = { fg = palette.sign_add, bold = true }, + DiffviewFilePanelDeletions = { fg = palette.sign_delete, bold = true }, + } end return M diff --git a/lua/no-clown-fiesta/groups/highlights.lua b/lua/no-clown-fiesta/groups/highlights.lua index eab09cb..a0a4c7f 100644 --- a/lua/no-clown-fiesta/groups/highlights.lua +++ b/lua/no-clown-fiesta/groups/highlights.lua @@ -36,7 +36,7 @@ function M.highlight(palette, opts) ), Folded = { fg = palette.light_gray, bg = palette.alt_bg }, FoldColumn = { fg = palette.light_gray, bg = palette.alt_bg }, - LineNr = { fg = palette.gray }, + LineNr = { fg = palette.medium_gray }, Whitespace = { fg = palette.gray }, VertSplit = { fg = palette.bg, bg = palette.accent }, CursorLine = { @@ -95,36 +95,36 @@ function M.highlight(palette, opts) Question = { fg = palette.cyan }, EndOfBuffer = { fg = palette.gray }, NonText = { fg = palette.fg }, - Variable = vim.tbl_extend("force", { fg = palette.white }, opts.styles.variables), + Variable = vim.tbl_extend("force", { fg = palette.fg }, opts.styles.variables), String = { fg = palette.medium_gray_blue }, Character = { fg = palette.green }, - Constant = { fg = palette.white }, + Constant = { fg = palette.fg }, Number = { fg = palette.red }, Boolean = { fg = palette.red }, Float = { fg = palette.red }, - Identifier = { fg = palette.white }, + Identifier = { fg = palette.fg }, Function = vim.tbl_extend("force", { fg = palette.cyan }, opts.styles.functions), - Operator = { fg = palette.white }, - Type = vim.tbl_extend("force", { fg = palette.white }, opts.styles.type), + Operator = { fg = palette.fg }, + Type = vim.tbl_extend("force", { fg = palette.fg }, opts.styles.type), StorageClass = { fg = palette.gray_blue }, Structure = { fg = palette.gray_blue }, - Typedef = { fg = palette.white }, + Typedef = { fg = palette.fg }, Keyword = vim.tbl_extend("force", { fg = palette.gray_blue }, opts.styles.keywords), Statement = { fg = palette.gray_blue }, Conditional = { fg = palette.gray_blue }, Repeat = { fg = palette.gray_blue }, - Label = { fg = palette.white }, + Label = { fg = palette.fg }, Exception = { fg = palette.red }, Include = { fg = palette.red }, - PreProc = { fg = palette.white }, + PreProc = { fg = palette.fg }, Define = { fg = palette.red }, Macro = { fg = palette.cyan }, PreCondit = { fg = palette.medium_gray }, - Special = { fg = palette.white }, + Special = { fg = palette.fg }, SpecialChar = { fg = palette.medium_gray_blue }, Tag = { fg = palette.blue }, Debug = { fg = palette.red }, - Delimiter = { fg = palette.white }, + Delimiter = { fg = palette.fg }, SpecialComment = vim.tbl_extend( "force", { fg = palette.medium_gray }, @@ -137,8 +137,8 @@ function M.highlight(palette, opts) Todo = { fg = palette.red, bg = palette.bg, bold = true }, Error = { fg = palette.error, bg = palette.bg, bold = true }, TabLine = { fg = palette.gray, bg = palette.alt_bg }, - TabLineSel = { fg = palette.white, bg = palette.alt_bg }, - TabLineFill = { fg = palette.white, bg = palette.alt_bg }, + TabLineSel = { fg = palette.fg, bg = palette.alt_bg }, + TabLineFill = { fg = palette.fg, bg = palette.alt_bg }, WinSeparator = { fg = palette.medium_gray, bg = palette.bg }, DiagnosticFloatingError = { fg = palette.error }, FloatBorder = { fg = palette.light_gray }, diff --git a/lua/no-clown-fiesta/groups/lazy.lua b/lua/no-clown-fiesta/groups/lazy.lua index 619bb9a..18d7e1e 100644 --- a/lua/no-clown-fiesta/groups/lazy.lua +++ b/lua/no-clown-fiesta/groups/lazy.lua @@ -5,7 +5,7 @@ function M.highlight(palette, opts) LazyButton = { fg = palette.fg }, LazyButtonActive = { fg = palette.fg, bold = true }, LazyComment = { fg = palette.medium_gray }, - LazyCommit = { fg = palette.white }, + LazyCommit = { fg = palette.fg }, LazyCommitIssue = { fg = palette.red }, LazyCommitScope = { fg = palette.cyan }, LazyCommitType = { fg = palette.cyan }, diff --git a/lua/no-clown-fiesta/groups/lir.lua b/lua/no-clown-fiesta/groups/lir.lua index d0579ca..080c6c4 100644 --- a/lua/no-clown-fiesta/groups/lir.lua +++ b/lua/no-clown-fiesta/groups/lir.lua @@ -3,7 +3,7 @@ local M = {} function M.highlight(palette, opts) return { LirFloatNormal = { fg = palette.fg, bg = palette.alt_bg }, - LirDir = { fg = palette.white }, + LirDir = { fg = palette.fg }, LirSymLink = { fg = palette.cyan }, LirEmptyDirText = { fg = palette.medium_gray }, } diff --git a/lua/no-clown-fiesta/groups/nvim-tree.lua b/lua/no-clown-fiesta/groups/nvim-tree.lua index 53fb408..6e2375a 100644 --- a/lua/no-clown-fiesta/groups/nvim-tree.lua +++ b/lua/no-clown-fiesta/groups/nvim-tree.lua @@ -2,12 +2,12 @@ local M = {} function M.highlight(palette, opts) return { - NvimTreeFolderIcon = { fg = palette.white }, + NvimTreeFolderIcon = { fg = palette.fg }, NvimTreeIndentMarker = { fg = palette.alt_bg }, NvimTreeNormal = { fg = palette.light_gray, bg = palette.alt_bg }, NvimTreeVertSplit = { fg = palette.alt_bg, bg = palette.alt_bg }, - NvimTreeFolderName = { fg = palette.white }, - NvimTreeOpenedFolderName = { fg = palette.white, bold = true }, + NvimTreeFolderName = { fg = palette.fg }, + NvimTreeOpenedFolderName = { fg = palette.fg, bold = true }, NvimTreeEmptyFolderName = { fg = palette.medium_gray }, NvimTreeGitIgnored = { fg = palette.medium_gray }, NvimTreeImageFile = { fg = palette.light_gray }, diff --git a/lua/no-clown-fiesta/groups/treesitter.lua b/lua/no-clown-fiesta/groups/treesitter.lua index f3ade89..5e3112a 100644 --- a/lua/no-clown-fiesta/groups/treesitter.lua +++ b/lua/no-clown-fiesta/groups/treesitter.lua @@ -2,8 +2,8 @@ local M = {} function M.highlight(palette, opts) return { - ["@annotation"] = { fg = palette.white }, - ["@attribute"] = { fg = palette.white }, + ["@annotation"] = { fg = palette.fg }, + ["@attribute"] = { fg = palette.fg }, ["@boolean"] = { fg = palette.red }, ["@character"] = { fg = palette.green }, ["@comment"] = { link = "Comment" }, @@ -14,7 +14,7 @@ function M.highlight(palette, opts) ["@comment.warning"] = { fg = palette.warning }, ["@const.builtin"] = { fg = palette.red }, ["@const.macro"] = { fg = palette.cyan }, - ["@constant"] = { fg = palette.white }, + ["@constant"] = { fg = palette.fg }, ["@constructor"] = { fg = palette.cyan }, ["@diff.delta"] = { fg = palette.gray_blue, @@ -47,7 +47,7 @@ function M.highlight(palette, opts) ["@keyword.import"] = { fg = palette.red }, ["@keyword.operator"] = { fg = palette.gray_blue }, ["@keyword.repeat"] = { fg = palette.gray_blue }, - ["@label"] = { fg = palette.white }, + ["@label"] = { fg = palette.fg }, ["@lsp.type.comment"] = {}, ["@markup"] = { fg = palette.fg }, ["@markup.italic"] = { italic = true }, @@ -58,33 +58,29 @@ function M.highlight(palette, opts) ["@markup.strong"] = { fg = palette.medium_gray }, ["@markup.title"] = { fg = palette.medium_gray }, ["@markup.underline"] = { underline = true }, - ["@module"] = { fg = palette.white }, + ["@module"] = { fg = palette.fg }, ["@number"] = { fg = palette.red }, ["@number.float"] = { fg = palette.red }, - ["@operator"] = { fg = palette.white }, - ["@property"] = { fg = palette.white }, - ["@punctuation.bracket"] = { fg = palette.white }, - ["@punctuation.delimiter"] = { fg = palette.white }, + ["@operator"] = { fg = palette.fg }, + ["@property"] = { fg = palette.fg }, + ["@punctuation.bracket"] = { fg = palette.fg }, + ["@punctuation.delimiter"] = { fg = palette.fg }, ["@string"] = { fg = palette.medium_gray_blue }, ["@string.escape"] = { fg = palette.medium_gray_blue }, ["@string.regexp"] = { fg = palette.medium_gray_blue }, ["@string.special.path"] = { fg = palette.light_gray }, ["@string.special.symbol"] = { fg = palette.medium_gray }, ["@tag"] = { fg = palette.blue }, - ["@tag.attribute"] = { fg = palette.white }, - ["@tag.delimiter"] = { fg = palette.white }, + ["@tag.attribute"] = { fg = palette.fg }, + ["@tag.delimiter"] = { fg = palette.fg }, ["@text.uri"] = { fg = palette.light_gray }, - ["@type"] = vim.tbl_extend("force", { fg = palette.white }, opts.styles.type), - ["@type.builtin"] = { fg = palette.white }, - ["@variable"] = vim.tbl_extend( - "force", - { fg = palette.white }, - opts.styles.variables - ), - ["@variable.builtin"] = { fg = palette.white }, - ["@variable.field"] = { fg = palette.white }, - ["@variable.parameter"] = { fg = palette.white }, - ["@variable.parameter.reference"] = { fg = palette.white }, + ["@type"] = vim.tbl_extend("force", { fg = palette.fg }, opts.styles.type), + ["@type.builtin"] = { fg = palette.fg }, + ["@variable"] = vim.tbl_extend("force", { fg = palette.fg }, opts.styles.variables), + ["@variable.builtin"] = { fg = palette.fg }, + ["@variable.field"] = { fg = palette.fg }, + ["@variable.parameter"] = { fg = palette.fg }, + ["@variable.parameter.reference"] = { fg = palette.fg }, } end diff --git a/lua/no-clown-fiesta/init.lua b/lua/no-clown-fiesta/init.lua index 8bad306..66a9c52 100644 --- a/lua/no-clown-fiesta/init.lua +++ b/lua/no-clown-fiesta/init.lua @@ -16,13 +16,16 @@ function M.load() vim.api.nvim_command "syntax reset" end - vim.o.background = "dark" + if opts.theme ~= "white" then + vim.o.background = "dark" + end vim.o.termguicolors = true vim.g.colors_name = "no-clown-fiesta" local util = require "no-clown-fiesta.util" - local palette = require "no-clown-fiesta.palette" + local palettes = require "no-clown-fiesta.palettes" local groups = require "no-clown-fiesta.groups" + local palette = palettes[opts.theme] for _, group in ipairs(groups) do group = group.highlight(palette, opts) diff --git a/lua/no-clown-fiesta/palette.lua b/lua/no-clown-fiesta/palette.lua deleted file mode 100644 index 298ce85..0000000 --- a/lua/no-clown-fiesta/palette.lua +++ /dev/null @@ -1,37 +0,0 @@ -local colors = { - none = "NONE", - fg = "#E1E1E1", - bg = "#151515", - alt_bg = "#171717", - accent = "#202020", - white = "#E1E1E1", - gray = "#373737", - medium_gray = "#727272", - light_gray = "#AFAFAF", - blue = "#BAD7FF", - gray_blue = "#7E97AB", - medium_gray_blue = "#A2B5C1", - cyan = "#88afa2", - red = "#b46958", - green = "#90A959", - yellow = "#F4BF75", - orange = "#FFA557", - purple = "#AA749F", - magenta = "#AA759F", - cursor_fg = "#151515", - cursor_bg = "#D0D0D0", - sign_add = "#586935", - sign_change = "#51657B", - sign_delete = "#984936", - error = "#984936", - warning = "#ab8550", - info = "#ab8550", - hint = "#576f82", - todo = "#578266", - accent_lighter_blue = "#1e222a", - accent_blue = "#18191b", - accent_green = "#181b18", - accent_red = "#1b1818", -} - -return colors diff --git a/lua/no-clown-fiesta/palettes.lua b/lua/no-clown-fiesta/palettes.lua new file mode 100644 index 0000000..965e35a --- /dev/null +++ b/lua/no-clown-fiesta/palettes.lua @@ -0,0 +1,106 @@ +local colors = { + dark = { + none = "NONE", + fg = "#E1E1E1", + bg = "#151515", + alt_bg = "#171717", + accent = "#202020", + gray = "#373737", + medium_gray = "#727272", + light_gray = "#AFAFAF", + blue = "#BAD7FF", + gray_blue = "#7E97AB", + medium_gray_blue = "#A2B5C1", + cyan = "#88afa2", + red = "#b46958", + green = "#90A959", + yellow = "#F4BF75", + orange = "#FFA557", + purple = "#AA749F", + magenta = "#AA759F", + cursor_fg = "#151515", + cursor_bg = "#D0D0D0", + sign_add = "#586935", + sign_change = "#51657B", + sign_delete = "#984936", + error = "#984936", + warning = "#ab8550", + info = "#ab8550", + hint = "#576f82", + todo = "#578266", + accent_lighter_blue = "#38404f", + accent_blue = "#18191B", + accent_green = "#181B18", + accent_red = "#1B1818", + }, + dim = { + none = "NONE", + fg = "#E1E1E1", + bg = "#303030", + alt_bg = "#323232", + accent = "#353535", + gray = "#373737", + medium_gray = "#727272", + light_gray = "#AFAFAF", + blue = "#BAD7FF", + gray_blue = "#7E97AB", + medium_gray_blue = "#A2B5C1", + cyan = "#88afa2", + red = "#b46958", + green = "#90A959", + yellow = "#F4BF75", + orange = "#FFA557", + purple = "#AA749F", + magenta = "#AA759F", + cursor_fg = "#151515", + cursor_bg = "#D0D0D0", + sign_add = "#586935", + sign_change = "#51657B", + sign_delete = "#984936", + error = "#984936", + warning = "#ab8550", + info = "#ab8550", + hint = "#576f82", + todo = "#578266", + accent_lighter_blue = "#474d50", + accent_blue = "#363a3c", + accent_green = "#363c36", + accent_red = "#3c3636", + }, + light = { + none = "NONE", + fg = "#151515", + bg = "#E1E1E1", + alt_bg = "#D6D6D6", + accent = "#cfcfcf", + gray = "#252525", + medium_gray = "#2B2B2B", + light_gray = "#373737", + blue = "#BAD7FF", + gray_blue = "#7E97AB", + medium_gray_blue = "#6E7B84", + cyan = "#59726a", + red = "#874e42", + green = "#677940", + yellow = "#b89058", + orange = "#FFA557", + purple = "#AA749F", + magenta = "#AA759F", + cursor_fg = "#D0D0D0", + cursor_bg = "#151515", + sign_add = "#586935", + sign_change = "#51657B", + sign_delete = "#984936", + error = "#984936", + warning = "#ab8550", + info = "#ab8550", + hint = "#576f82", + todo = "#578266", + accent_lighter_blue = "#B1B9C8", + accent_blue = "#C6D5DE", + accent_green = "#CCDEC6", + accent_red = "#DEC6C6", + }, +} + +return colors diff --git a/lua/no-clown-fiesta/settings.lua b/lua/no-clown-fiesta/settings.lua index 791bea8..68a3523 100644 --- a/lua/no-clown-fiesta/settings.lua +++ b/lua/no-clown-fiesta/settings.lua @@ -1,6 +1,7 @@ local M = {} local DEFAULT = { + theme = "dark", transparent = false, styles = { comments = {}, -- cgit v1.2.3-70-g09d2