Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad argument #1 to 'rshift' in color.lua:127 #330

Open
thewinger opened this issue Jun 21, 2024 · 1 comment
Open

Bad argument #1 to 'rshift' in color.lua:127 #330

thewinger opened this issue Jun 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@thewinger
Copy link

Hi,
I'm trying to override the color palettes, but as soon as I add pink, blue or cyan i get the following error message:

Failed to run `config` for github-nvim-theme

...im/lazy/github-nvim-theme/lua/github-theme/lib/color.lua:127: bad argument #1 to 'rshift' (number expected, got nil)

# stacktrace:
  - /github-nvim-theme/lua/github-theme/lib/color.lua:127 _in_ **from_hex**
  - /github-nvim-theme/lua/github-theme/group/editor.lua:22 _in_ **get**
  - /github-nvim-theme/lua/github-theme/group.lua:26 _in_ **from**
  - /github-nvim-theme/lua/github-theme/lib/compiler.lua:33 _in_ **compile**
  - /github-nvim-theme/lua/github-theme/init.lua:37 _in_ **compile**
  - /github-nvim-theme/lua/github-theme/init.lua:109 _in_ **setup**
  - ~/.config/nvim/lua/plugins/colorscheme.lua:43 _in_ **config**
  - ~/.config/nvim/lua/core/lazy.lua:21
  - ~/.config/nvim/lua/core/init.lua:4
  - init.lua:1

This is my config for the theme:

{
  {
    "projekt0n/github-nvim-theme",
    priority = 1000,
    lazy = false,
    config = function()
      local palettes = {
        all = {
          white = "#f8fafc",
          black = "#1d283a",
          gray = "#94a3b8",
          green = "#36d399",
          magenta = "#a689fa",
          red = "#fb6f84",
          yellow = "#fddf49",
          -- pink = "#f471b5",
          blue = "#7ed4fc",
          -- cyan = "#67e8f9",
        },
      }
      local specs = {
        github_dark_dimmed = {
          syntax = {
            keyword = "pink",
          },
        },
      }

      require("github-theme").setup({
        palettes = palettes,
        specs = specs,
        options = {
          transparent = true,
        },
      })
      vim.cmd("colorscheme github_dark_dimmed")
    end,
  },
@tmillr tmillr added needs investigation bug Something isn't working labels Jul 12, 2024
@tmillr
Copy link
Member

tmillr commented Jul 12, 2024

Thanks for documenting this. It seems to be due to lines like this:

NeoTreeSymbolicLinkTarget = { fg = blend(c.pink.base, 0.5) },

...which fails because pink is now a string instead of a table of strings (due to your override).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants