feat: allow colour overrides

closes #10
This commit is contained in:
mvllow 2021-10-12 12:14:41 -05:00
commit 5beedc0a76
2 changed files with 46 additions and 28 deletions

View file

@ -1,5 +1,14 @@
local p = require('rose-pine.palette') local p = require('rose-pine.palette')
local user_colors = vim.g.rose_pine_colors or {}
local groups = {
comment = user_colors.comment or p.subtle,
hint = user_colors.hint or p.iris,
info = user_colors.info or p.foam,
warn = user_colors.warn or p.gold,
error = user_colors.error or p.love,
}
local theme = {} local theme = {}
local maybe_base = p.base local maybe_base = p.base
local maybe_italic = 'italic' local maybe_italic = 'italic'
@ -76,7 +85,7 @@ theme.base = {
Boolean = { fg = p.gold }, Boolean = { fg = p.gold },
Character = { fg = p.gold }, Character = { fg = p.gold },
Comment = { Comment = {
fg = p.subtle, fg = groups.comment,
style = maybe_italic, style = maybe_italic,
}, },
Conditional = { fg = p.pine }, Conditional = { fg = p.pine },
@ -119,35 +128,35 @@ theme.base = {
htmlTagN = { fg = p.text }, htmlTagN = { fg = p.text },
htmlTagName = { fg = p.foam }, htmlTagName = { fg = p.foam },
DiagnosticHint = { fg = p.iris }, DiagnosticHint = { fg = groups.hint },
DiagnosticInfo = { fg = p.foam }, DiagnosticInfo = { fg = groups.info },
DiagnosticWarn = { fg = p.gold }, DiagnosticWarn = { fg = groups.warn },
DiagnosticError = { fg = p.love }, DiagnosticError = { fg = groups.error },
DiagnosticDefaultHint = { fg = p.iris }, DiagnosticDefaultHint = { fg = groups.hint },
DiagnosticDefaultInfo = { fg = p.foam }, DiagnosticDefaultInfo = { fg = groups.info },
DiagnosticDefaultWarn = { fg = p.gold }, DiagnosticDefaultWarn = { fg = groups.warn },
DiagnosticDefaultError = { fg = p.love }, DiagnosticDefaultError = { fg = groups.error },
DiagnosticFloatingHint = { fg = p.iris }, DiagnosticFloatingHint = { fg = groups.hint },
DiagnosticFloatingInfo = { fg = p.foam }, DiagnosticFloatingInfo = { fg = groups.info },
DiagnosticFloatingWarn = { fg = p.gold }, DiagnosticFloatingWarn = { fg = groups.warn },
DiagnosticFloatingError = { fg = p.love }, DiagnosticFloatingError = { fg = groups.error },
DiagnosticSignHint = { fg = p.iris }, DiagnosticSignHint = { fg = groups.hint },
DiagnosticSignInfo = { fg = p.foam }, DiagnosticSignInfo = { fg = groups.info },
DiagnosticSignWarn = { fg = p.gold }, DiagnosticSignWarn = { fg = groups.warn },
DiagnosticSignError = { fg = p.love }, DiagnosticSignError = { fg = groups.error },
DiagnosticUnderlineHint = { style = 'undercurl', sp = p.iris }, DiagnosticUnderlineHint = { style = 'undercurl', sp = groups.hint },
DiagnosticUnderlineInfo = { style = 'undercurl', sp = p.foam }, DiagnosticUnderlineInfo = { style = 'undercurl', sp = groups.info },
DiagnosticUnderlineWarn = { style = 'undercurl', sp = p.gold }, DiagnosticUnderlineWarn = { style = 'undercurl', sp = groups.warn },
DiagnosticUnderlineError = { style = 'undercurl', sp = p.love }, DiagnosticUnderlineError = { style = 'undercurl', sp = groups.error },
DiagnosticVirtualTextHint = { fg = p.iris }, DiagnosticVirtualTextHint = { fg = groups.hint },
DiagnosticVirtualTextInfo = { fg = p.foam }, DiagnosticVirtualTextInfo = { fg = groups.info },
DiagnosticVirtualTextWarn = { fg = p.gold }, DiagnosticVirtualTextWarn = { fg = groups.warn },
DiagnosticVirtualTextError = { fg = p.love }, DiagnosticVirtualTextError = { fg = groups.error },
LspReferenceText = { fg = p.rose, bg = p.highlight }, LspReferenceText = { fg = p.rose, bg = p.highlight },
LspReferenceRead = { fg = p.rose, bg = p.highlight }, LspReferenceRead = { fg = p.rose, bg = p.highlight },
@ -221,7 +230,7 @@ theme.treesitter = {
TSBoolean = { fg = p.rose }, TSBoolean = { fg = p.rose },
-- TSCharacter = {}, -- TSCharacter = {},
TSComment = { TSComment = {
fg = p.subtle, fg = groups.comment,
style = maybe_italic, style = maybe_italic,
}, },
-- TSConditional = {}, -- TSConditional = {},

View file

@ -46,9 +46,9 @@ local colors = require("galaxyline.themes.colors")["rose-pine"]
``` ```
> **IMPORTANT**: > **IMPORTANT**:
> >
> 1. This requires [NTBBloodbath's galaxyline fork](https://github.com/NTBBloodbath/galaxyline.nvim) in order to work. > 1. This requires [NTBBloodbath's galaxyline fork](https://github.com/NTBBloodbath/galaxyline.nvim) in order to work.
> >
> 2. You can see the list of available colors [here](https://github.com/NTBBloodbath/galaxyline.nvim/blob/main/docs/themes.md#colors-standards). > 2. You can see the list of available colors [here](https://github.com/NTBBloodbath/galaxyline.nvim/blob/main/docs/themes.md#colors-standards).
## Plugin Support ## Plugin Support
@ -97,6 +97,15 @@ vim.g.rose_pine_disable_background = false
-- Use bold vertical split line -- Use bold vertical split line
vim.g.rose_pine_bold_vertical_split_line = true vim.g.rose_pine_bold_vertical_split_line = true
-- Override theme groups
vim.g.rose_pine_colors = {
comment = '#ffffff',
hint = '#9745be',
info = '#78ccc5',
warn = '#f5c359',
error = '#c75c6a',
}
-- Set colorscheme after options -- Set colorscheme after options
vim.cmd('colorscheme rose-pine') vim.cmd('colorscheme rose-pine')
``` ```