From 711f218756f68bcd5e6a9b9d837468a96f740fc6 Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Thu, 9 Mar 2023 11:07:23 +0700 Subject: [PATCH] add `palettes` configuration key --- lua/rose-pine/config.lua | 3 +++ lua/rose-pine/palette.lua | 2 ++ readme.md | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua index 156bb7e..59aeb0e 100644 --- a/lua/rose-pine/config.lua +++ b/lua/rose-pine/config.lua @@ -40,6 +40,7 @@ local M = {} ---@field disable_background boolean ---@field disable_float_background boolean ---@field disable_italics boolean +---@field palettes table ---@field groups Groups ---@field highlight_groups table local defaults = { @@ -52,6 +53,8 @@ local defaults = { disable_italics = false, highlight_groups = {}, + palettes = {}, + groups = { background = 'base', background_nc = '_experimental_nc', diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua index 5ede492..15dda17 100644 --- a/lua/rose-pine/palette.lua +++ b/lua/rose-pine/palette.lua @@ -60,6 +60,8 @@ local variants = { }, } +variants = vim.tbl_deep_extend('force', variants, options.palettes) + if options.variant == 'main' then return variants.main end diff --git a/readme.md b/readme.md index b1a4c84..bbebb6b 100644 --- a/readme.md +++ b/readme.md @@ -65,6 +65,17 @@ require('rose-pine').setup({ disable_float_background = false, disable_italics = false, + --- @usage palette tables with hex values + palettes = { + main = { + -- You can change an existing color + -- base = '#242424', + + -- Or create a new one + -- custom = '#FF0000', + }, + } + --- @usage string hex value or named color from rosepinetheme.com/palette groups = { background = 'base',