Skip to content

Cannot change palette colour #346

Closed
Closed

Description

@pmatulis

I tried using this in my Lua file but it does not do anything:

    palette = {
        dawn = {
            gold = '#a87024',
            base = '#cccccc',
        },
    },

Even directly changing the colour (for gold) in the groups stanza does nothing:

        h4 = "#a87024",

Activity

  1. mvllow commented on Mar 4, 2025

    @mvllow
    Member

    If you post your entire Rosé Pine setup I can try to help debug further but using this in my own setup works as expected:

    require("rose-pine").setup({
    	palette = {
    		dawn = {
    			gold = "#a87024",
    			base = "#cccccc"
    		}
    	}
    })
    
  2. pmatulis commented on Mar 4, 2025

    @pmatulis
    Author

    plugin loaded with:

    Plug 'https://github.com/rose-pine/neovim', { 'as': 'rose-pine' }

    init.vim contains

    require("rose-pine-conf")
    .
    .
    .
    set background=light
    colorscheme rose-pine-dawn
    
    require("rose-pine").setup({
        variant = "auto", -- auto, main, moon, or dawn
        dark_variant = "main", -- main, moon, or dawn
        dim_inactive_windows = false,
        extend_background_behind_borders = true,
    
        enable = {
            terminal = true,
            legacy_highlights = true, -- Improve compatibility for previous versions of Neovim
            migrations = true, -- Handle deprecated options automatically
        },
    
        styles = {
            bold = true,
            italic = true,
            transparency = false,
        },
    
        groups = {
            border = "muted",
            link = "iris",
            panel = "surface",
    
            error = "love",
            hint = "iris",
            info = "foam",
            note = "pine",
            todo = "rose",
            warn = "gold",
    
            git_add = "foam",
            git_change = "rose",
            git_delete = "love",
            git_dirty = "rose",
            git_ignore = "muted",
            git_merge = "iris",
            git_rename = "pine",
            git_stage = "iris",
            git_text = "rose",
            git_untracked = "subtle",
    
            h1 = "iris",
            h2 = "foam",
            h3 = "rose",
            h4 = "#b87024",
            h5 = "pine",
            h6 = "foam",
        },
    
        palette = {
            dawn = {
                gold = '#a87024',
                base = '#cccccc',
            },
        },
    
        palette = {
            -- Override the builtin palette per variant
            -- moon = {
            --     base = '#18191a',
            --     overlay = '#363738',
            -- },
        },
    
        -- 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)
            -- Disable all undercurls
            -- if highlight.undercurl then
            --     highlight.undercurl = false
            -- end
            --
            -- Change palette colour
            -- if highlight.fg == palette.pine then
            --     highlight.fg = palette.foam
            -- end
        end,
    })
    
  3. mvllow commented on Mar 4, 2025

    @mvllow
    Member

    You are using require("rose-pine-conf") in a vimscript file, but this is lua syntax. I think you can prefix this line with "lua".

    As far as the Rosé Pine setup, you have the palette key twice, so the second instance may overwrite your custom palette.

  4. locked and limited conversation to collaborators on Mar 4, 2025
  5. converted this issue into a discussion #347 on Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions