add palettes configuration key

This commit is contained in:
mrtnvgr 2023-03-09 11:07:23 +07:00
commit 711f218756
No known key found for this signature in database
GPG key ID: 5B3379E981EF48B1
3 changed files with 16 additions and 0 deletions

View file

@ -40,6 +40,7 @@ local M = {}
---@field disable_background boolean
---@field disable_float_background boolean
---@field disable_italics boolean
---@field palettes table<table>
---@field groups Groups
---@field highlight_groups table<string, any>
local defaults = {
@ -52,6 +53,8 @@ local defaults = {
disable_italics = false,
highlight_groups = {},
palettes = {},
groups = {
background = 'base',
background_nc = '_experimental_nc',

View file

@ -60,6 +60,8 @@ local variants = {
},
}
variants = vim.tbl_deep_extend('force', variants, options.palettes)
if options.variant == 'main' then
return variants.main
end

View file

@ -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',