Compare commits

...

16 commits

Author SHA1 Message Date
Antoine Bertin
72a04c4065
feat: add AvantePromptInput highlight support (#368)
* feat: add AvantePromptInput highlight support
2025-08-24 09:50:23 -05:00
HieuDao-code
0e70556c8c
feat(diffview.nvim): add support for sindrets/diffview.nvim (#369) 2025-08-24 09:47:05 -05:00
Dawid Karpiński
72befaffea
fix: do not clear blend prop from highlight (#351)
* add private built-in blend override

---------

Co-authored-by: mvllow <mvllow@icloud.com>
2025-07-18 15:25:55 -05:00
fdcote
f93360149e
feat: add ModesFormat (#367) 2025-06-26 16:32:32 -05:00
Adrian Schneider
83c66bcadb
feat(grug-far): add highlight groups for add/remove results (#366) 2025-06-26 12:31:24 -05:00
fdcote
6b9840790c feat: add QuickFixLine (#357) 2025-05-05 12:13:20 -05:00
Andrei Heidelbacher
d195ed8673 feat(blink.cmp): improve BlinkCmpDoc contrast between current line (#356) 2025-05-01 16:55:24 -05:00
Andrei Heidelbacher
a67f5ef34b fix(blink.cmp): remove dedicated BlinkCmpDoc highlight (#355)
The default `BlinkCmpDoc` highlight is linked to `NormalFloat`, which is
a sensible default. However, due to overriding the default link with
only `fg` provided, the `bg` is cleared and the documentation popup is
indistinguishable from regular text.

This change is technically a no-op in terms of intended palette, because
`NormalFloat` should already use `palette.text`, and only fixes the
cleared `bg` bug.
2025-04-30 20:53:00 -05:00
Andrei Heidelbacher
39ec539f83 feat(lualine): change background from base to surface (#354)
This change improves the contrast of the statusline while aligning with the theme's spec.
2025-04-30 20:02:53 -05:00
aileot
5ccc379822 fix: set background=light if variant is "dawn" (#349)
* fix: set `background=light` if variant is "dawn"

This change might fix https://github.com/rose-pine/neovim/issues/321

* Update lua/rose-pine.lua

* fix: restrict variants that override `&background`

The other variant params are considered as if "auto"
2025-03-31 10:27:19 -05:00
stelo
d7dc9cd3f2 feat: extends DapUIType fg to iris (#348) 2025-03-11 21:25:25 -05:00
mvllow
44739383b9 docs: add highlight group examples with blend and inherit options 2025-02-25 19:58:52 -06:00
Tiago
8b216f7252 feat: add support for vim-sneak (#342) 2025-02-23 15:19:21 -06:00
mvllow
0511701746 feat: use experimental darker text for dawn 2025-02-05 19:49:14 -06:00
mvllow
946de320f4 fix: strip non-standard blend properties 2025-02-05 19:36:24 -06:00
mvllow
340cf5ed5e feat(perf): cache colors for up to 3x speed improvements 2025-02-05 19:35:55 -06:00
5 changed files with 90 additions and 8 deletions

View file

@ -1,7 +1,7 @@
local p = require("rose-pine.palette")
local config = require("rose-pine.config")
local bg_base = p.base
local bg_base = p.surface
if config.options.styles.transparency then
bg_base = "NONE"
end

View file

@ -121,7 +121,7 @@ local function set_highlights()
PmenuSel = { fg = palette.text, bg = palette.overlay },
PmenuThumb = { bg = palette.muted },
Question = { fg = palette.gold },
-- QuickFixLink = {},
QuickFixLine = { fg = palette.foam },
-- RedrawDebugNormal = {},
RedrawDebugClear = { fg = palette.base, bg = palette.gold },
RedrawDebugComposed = { fg = palette.base, bg = palette.pine },
@ -462,6 +462,7 @@ local function set_highlights()
-- mvllow/modes.nvim
ModesCopy = { bg = palette.gold },
ModesDelete = { bg = palette.love },
ModesFormat = { bg = palette.rose },
ModesInsert = { bg = palette.foam },
ModesReplace = { bg = palette.pine },
ModesVisual = { bg = palette.iris },
@ -722,6 +723,7 @@ local function set_highlights()
DapUIThread = { fg = palette.gold },
DapUIValue = { fg = palette.text },
DapUIVariable = { fg = palette.text },
DapUIType = { fg = palette.iris },
DapUIWatchesEmpty = { fg = palette.love },
DapUIWatchesError = { link = "DapUIWatchesEmpty" },
DapUIWatchesValue = { link = "DapUIThread" },
@ -960,6 +962,8 @@ local function set_highlights()
GrugFarInputPlaceholder = { link = "Comment" },
GrugFarResultsActionMessage = { fg = palette.foam },
GrugFarResultsChangeIndicator = { fg = groups.git_change },
GrugFarResultsRemoveIndicator = { fg = groups.git_delete },
GrugFarResultsAddIndicator = { fg = groups.git_add },
GrugFarResultsHeader = { fg = palette.pine },
GrugFarResultsLineNo = { fg = palette.iris },
GrugFarResultsLineColumn = { link = "GrugFarResultsLineNo" },
@ -974,9 +978,12 @@ local function set_highlights()
AvanteReversedSubtitle = { fg = palette.foam },
AvanteThirdTitle = { fg = palette.highlight_med, bg = palette.iris },
AvanteReversedThirdTitle = { fg = palette.iris },
AvantePromptInput = { fg = palette.text, bg = groups.panel },
AvantePromptInputBorder = { fg = groups.border },
-- Saghen/blink.cmp
BlinkCmpDoc = { fg = palette.text },
BlinkCmpDoc = { bg = palette.highlight_low },
BlinkCmpDocSeparator = { bg = palette.highlight_low },
BlinkCmpDocBorder = { fg = palette.highlight_high },
BlinkCmpGhostText = { fg = palette.muted },
@ -1022,6 +1029,44 @@ local function set_highlights()
SnacksIndentScope = { fg = palette.foam },
SnacksPickerMatch = { fg = palette.rose, bold = styles.bold },
-- justinmk/vim-sneak
Sneak = { fg = palette.base, bg = palette.love },
SneakCurrent = { link = "StatusLineTerm" },
SneakScope = { link = "IncSearch" },
-- sindrets/diffview.nvim
DiffviewPrimary = { fg = palette.pine },
DiffviewSecondary = { fg = palette.foam },
DiffviewNormal = { fg = palette.text, bg = palette.surface },
DiffviewWinSeparator = { fg = palette.text, bg = palette.surface },
DiffviewFilePanelTitle = { fg = palette.foam, bold = styles.bold },
DiffviewFilePanelCounter = { fg = palette.rose },
DiffviewFilePanelRootPath = { fg = palette.foam, bold = styles.bold },
DiffviewFilePanelFileName = { fg = palette.text },
DiffviewFilePanelSelected = { fg = palette.gold },
DiffviewFilePanelPath = { link = "Comment" },
DiffviewFilePanelInsertions = { fg = groups.git_add },
DiffviewFilePanelDeletions = { fg = groups.git_delete },
DiffviewFilePanelConflicts = { fg = groups.git_merge },
DiffviewFolderName = { fg = palette.foam, bold = styles.bold },
DiffviewFolderSign = { fg = palette.subtle },
DiffviewHash = { fg = palette.rose },
DiffviewReference = { fg = palette.foam, bold = styles.bold },
DiffviewReflogSelector = { fg = palette.rose },
DiffviewStatusAdded = { fg = groups.git_add },
DiffviewStatusUntracked = { fg = groups.untracked },
DiffviewStatusModified = { fg = groups.git_change },
DiffviewStatusRenamed = { fg = groups.git_rename },
DiffviewStatusCopied = { fg = groups.untracked },
DiffviewStatusTypeChange = { fg = groups.git_change },
DiffviewStatusUnmerged = { fg = groups.git_change },
DiffviewStatusUnknown = { fg = groups.git_delete },
DiffviewStatusDeleted = { fg = groups.git_delete },
DiffviewStatusBroken = { fg = groups.git_delete },
DiffviewStatusIgnored = { fg = groups.git_ignore },
}
local transparency_highlights = {
DiagnosticVirtualTextError = { fg = groups.error },
@ -1122,9 +1167,18 @@ local function set_highlights()
if config.options.before_highlight ~= nil then
config.options.before_highlight(group, highlight, palette)
end
if highlight.blend ~= nil and (highlight.blend >= 0 and highlight.blend <= 100) and highlight.bg ~= nil then
highlight.bg = utilities.blend(highlight.bg, highlight.blend_on or palette.base, highlight.blend / 100)
end
highlight.blend = nil
highlight.blend_on = nil
if highlight._nvim_blend ~= nil then
highlight.blend = highlight._nvim_blend
end
vim.api.nvim_set_hl(0, group, highlight)
end
@ -1171,6 +1225,12 @@ function M.colorscheme(variant)
end
vim.g.colors_name = "rose-pine"
if variant == "dawn" then
vim.o.background = "light"
elseif variant == "main" or variant == "moon" then
vim.o.background = "dark"
end
set_highlights()
end

View file

@ -47,7 +47,7 @@ local variants = {
overlay = "#f2e9e1",
muted = "#9893a5",
subtle = "#797593",
text = "#575279",
text = "#464261",
love = "#b4637a",
gold = "#ea9d34",
rose = "#d7827e",

View file

@ -14,10 +14,17 @@ local function color_to_rgb(color)
return { byte(new_color, 16), byte(new_color, 8), byte(new_color, 0) }
end
local color_cache = {}
---@param color string Palette key or hex value
function utilities.parse_color(color)
if color_cache[color] then
return color_cache[color]
end
if color == nil then
return print("Invalid color: " .. color)
print("Invalid color: " .. color)
return nil
end
color = color:lower()
@ -26,13 +33,21 @@ function utilities.parse_color(color)
color = require("rose-pine.palette")[color] or vim.api.nvim_get_color_by_name(color)
end
color_cache[color] = color
return color
end
local blend_cache = {}
---@param fg string Foreground color
---@param bg string Background color
---@param alpha number Between 0 (background) and 1 (foreground)
function utilities.blend(fg, bg, alpha)
local cache_key = fg .. bg .. alpha
if blend_cache[cache_key] then
return blend_cache[cache_key]
end
local fg_rgb = color_to_rgb(fg)
local bg_rgb = color_to_rgb(bg)
@ -41,7 +56,10 @@ function utilities.blend(fg, bg, alpha)
return math.floor(math.min(math.max(0, ret), 255) + 0.5)
end
return string.format("#%02X%02X%02X", blend_channel(1), blend_channel(2), blend_channel(3))
local result = string.format("#%02X%02X%02X", blend_channel(1), blend_channel(2), blend_channel(3))
blend_cache[cache_key] = result
return result
end
return utilities

View file

@ -27,8 +27,8 @@ Install `rose-pine/neovim` using your favourite package manager:
```lua
-- lua/plugins/rose-pine.lua
return {
"rose-pine/neovim",
return {
"rose-pine/neovim",
name = "rose-pine",
config = function()
vim.cmd("colorscheme rose-pine")
@ -123,9 +123,13 @@ require("rose-pine").setup({
-- },
},
-- NOTE: Highlight groups are extended (merged) by default. Disable this
-- per group via `inherit = false`
highlight_groups = {
-- Comment = { fg = "foam" },
-- StatusLine = { fg = "love", bg = "love", blend = 15 },
-- VertSplit = { fg = "muted", bg = "muted" },
-- Visual = { fg = "base", bg = "text", inherit = false },
},
before_highlight = function(group, highlight, palette)