feat: add background_nc and panel_nc groups (#130) (#132)

This commit is contained in:
not 2023-03-06 14:40:10 -06:00 committed by GitHub
commit 826458a62c
4 changed files with 30 additions and 24 deletions

View file

@ -2,7 +2,9 @@ local M = {}
---@class Groups ---@class Groups
---@field background string ---@field background string
---@field background_nc string
---@field panel string ---@field panel string
---@field panel_nc string
---@field border string ---@field border string
---@field comment string ---@field comment string
---@field link string ---@field link string
@ -52,7 +54,9 @@ local defaults = {
groups = { groups = {
background = 'base', background = 'base',
background_nc = '_experimental_nc',
panel = 'surface', panel = 'surface',
panel_nc = 'base',
border = 'highlight_med', border = 'highlight_med',
comment = 'muted', comment = 'muted',
link = 'iris', link = 'iris',

View file

@ -2,7 +2,7 @@ local options = require('rose-pine.config').options
local variants = { local variants = {
main = { main = {
nc = '#16141f', _experimental_nc = '#16141f',
base = '#191724', base = '#191724',
surface = '#1f1d2e', surface = '#1f1d2e',
overlay = '#26233a', overlay = '#26233a',
@ -21,7 +21,7 @@ local variants = {
none = 'NONE', none = 'NONE',
}, },
moon = { moon = {
nc = '#1f1d30', _experimental_nc = '#1f1d30',
base = '#232136', base = '#232136',
surface = '#2a273f', surface = '#2a273f',
overlay = '#393552', overlay = '#393552',
@ -40,7 +40,7 @@ local variants = {
none = 'NONE', none = 'NONE',
}, },
dawn = { dawn = {
nc = '#f8f0e7', _experimental_nc = '#f8f0e7',
base = '#faf4ed', base = '#faf4ed',
surface = '#fffaf3', surface = '#fffaf3',
overlay = '#f2e9e1', overlay = '#f2e9e1',

View file

@ -7,13 +7,15 @@ function M._load(options)
local groups = options.groups or {} local groups = options.groups or {}
local maybe = { local maybe = {
base = (options.disable_background and p.none) or p.base, base = (options.disable_background and p.none) or groups.background,
surface = (options.disable_float_background and p.none) or p.surface, surface = (options.disable_float_background and p.none) or groups.panel,
italic = not options.disable_italics, italic = not options.disable_italics,
} }
maybe.bold_vert_split = (options.bold_vert_split and groups.border) maybe.bold_vert_split = (options.bold_vert_split and groups.border)
or p.none or p.none
maybe.dim_nc_background = (options.dim_nc_background and p.nc) maybe.dim_nc_background = (
options.dim_nc_background and groups.background_nc
) or maybe.base
h('ColorColumn', { bg = p.overlay }) h('ColorColumn', { bg = p.overlay })
h('Conceal', { bg = p.none }) h('Conceal', { bg = p.none })
@ -50,7 +52,7 @@ function M._load(options)
h('NormalFloat', { fg = p.text, bg = maybe.surface }) h('NormalFloat', { fg = p.text, bg = maybe.surface })
h('NormalNC', { fg = p.text, bg = maybe.dim_nc_background }) h('NormalNC', { fg = p.text, bg = maybe.dim_nc_background })
h('NvimInternalError', { fg = '#ffffff', bg = p.love }) h('NvimInternalError', { fg = '#ffffff', bg = p.love })
h('Pmenu', { fg = p.subtle, bg = p.maybe_surface }) h('Pmenu', { fg = p.subtle, bg = maybe.surface })
h('PmenuSbar', { bg = p.highlight_low }) h('PmenuSbar', { bg = p.highlight_low })
h('PmenuSel', { fg = p.text, bg = p.overlay }) h('PmenuSel', { fg = p.text, bg = p.overlay })
h('PmenuThumb', { bg = p.highlight_med }) h('PmenuThumb', { bg = p.highlight_med })
@ -70,12 +72,12 @@ function M._load(options)
fg = p.text, fg = p.text,
bg = (options.dim_nc_background and p.none) or maybe.base, bg = (options.dim_nc_background and p.none) or maybe.base,
}) })
h('StatusLine', { fg = p.subtle, bg = p.surface }) h('StatusLine', { fg = p.subtle, bg = groups.panel })
h('StatusLineNC', { fg = p.muted, bg = maybe.base }) h('StatusLineNC', { fg = p.muted, bg = groups.panel_nc })
h('StatusLineTerm', { link = 'StatusLine' }) h('StatusLineTerm', { link = 'StatusLine' })
h('StatusLineTermNC', { link = 'StatusLineNC' }) h('StatusLineTermNC', { link = 'StatusLineNC' })
h('TabLine', { fg = p.subtle, bg = p.surface }) h('TabLine', { fg = p.subtle, bg = groups.panel })
h('TabLineFill', { bg = p.surface }) h('TabLineFill', { bg = groups.panel })
h('TabLineSel', { fg = p.text, bg = p.overlay }) h('TabLineSel', { fg = p.text, bg = p.overlay })
h('Title', { fg = p.text }) h('Title', { fg = p.text })
h('VertSplit', { fg = groups.border, bg = maybe.bold_vert_split }) h('VertSplit', { fg = groups.border, bg = maybe.bold_vert_split })
@ -183,10 +185,10 @@ function M._load(options)
h('DiagnosticSignHint', { fg = groups.hint }) h('DiagnosticSignHint', { fg = groups.hint })
h('DiagnosticSignInfo', { fg = groups.info }) h('DiagnosticSignInfo', { fg = groups.info })
h('DiagnosticSignWarn', { fg = groups.warn }) h('DiagnosticSignWarn', { fg = groups.warn })
h('DiagnosticStatusLineError', { fg = groups.error, bg = p.surface }) h('DiagnosticStatusLineError', { fg = groups.error, bg = groups.panel })
h('DiagnosticStatusLineHint', { fg = groups.hint, bg = p.surface }) h('DiagnosticStatusLineHint', { fg = groups.hint, bg = groups.panel })
h('DiagnosticStatusLineInfo', { fg = groups.info, bg = p.surface }) h('DiagnosticStatusLineInfo', { fg = groups.info, bg = groups.panel })
h('DiagnosticStatusLineWarn', { fg = groups.warn, bg = p.surface }) h('DiagnosticStatusLineWarn', { fg = groups.warn, bg = groups.panel })
h('DiagnosticUnderlineError', { sp = groups.error, undercurl = true }) h('DiagnosticUnderlineError', { sp = groups.error, undercurl = true })
h('DiagnosticUnderlineHint', { sp = groups.hint, undercurl = true }) h('DiagnosticUnderlineHint', { sp = groups.hint, undercurl = true })
h('DiagnosticUnderlineInfo', { sp = groups.info, undercurl = true }) h('DiagnosticUnderlineInfo', { sp = groups.info, undercurl = true })
@ -424,22 +426,20 @@ function M._load(options)
h('PounceGap', { link = 'Search' }) h('PounceGap', { link = 'Search' })
h('PounceMatch', { link = 'Search' }) h('PounceMatch', { link = 'Search' })
local float_background = options.dim_nc_background
and (options.disable_float_background and groups.panel_nc or groups.panel)
or maybe.surface
-- ggandor/leap.nvim -- ggandor/leap.nvim
h('LeapMatch', { link = 'MatchParen' }) h('LeapMatch', { link = 'MatchParen' })
h('LeapLabelPrimary', { link = 'IncSearch' }) h('LeapLabelPrimary', { link = 'IncSearch' })
h('LeapLabelSecondary', { fg = p.base, bg = p.pine }) h('LeapLabelSecondary', { fg = p.base, bg = p.pine })
-- nvim-telescope/telescope.nvim -- nvim-telescope/telescope.nvim
h('TelescopeBorder', { fg = groups.border, bg = maybe.surface }) h('TelescopeBorder', { fg = groups.border, bg = float_background })
h('TelescopeMatching', { fg = p.rose }) h('TelescopeMatching', { fg = p.rose })
h('TelescopeNormal', { fg = p.subtle, bg = maybe.surface }) h('TelescopeNormal', { fg = p.subtle, bg = float_background })
h('TelescopePromptNormal', { h('TelescopePromptNormal', { fg = p.text, bg = float_background })
fg = p.text,
bg = (
options.dim_nc_background
and (options.disable_float_background and p.nc or p.surface)
) or maybe.surface,
})
h('TelescopePromptPrefix', { fg = p.subtle }) h('TelescopePromptPrefix', { fg = p.subtle })
h('TelescopeSelection', { fg = p.text, bg = p.overlay }) h('TelescopeSelection', { fg = p.text, bg = p.overlay })
h('TelescopeSelectionCaret', { fg = p.rose, bg = p.overlay }) h('TelescopeSelectionCaret', { fg = p.rose, bg = p.overlay })

View file

@ -78,7 +78,9 @@ require('rose-pine').setup({
--- @usage string hex value or named color from rosepinetheme.com/palette --- @usage string hex value or named color from rosepinetheme.com/palette
groups = { groups = {
background = 'base', background = 'base',
background_nc = '_experimental_nc',
panel = 'surface', panel = 'surface',
panel_nc = 'base',
border = 'highlight_med', border = 'highlight_med',
comment = 'muted', comment = 'muted',
link = 'iris', link = 'iris',