ziontee113 / color-picker.nvim

A powerful Neovim plugin that lets users choose & modify RGB/HSL/HEX colors.
MIT License
281 stars 8 forks source link

Color preview and rounded borders not working #24

Closed wilfredjonathanjames closed 1 year ago

wilfredjonathanjames commented 1 year ago

Hi there. I've installed this on MacOS and the color preview and rounded borders aren't showing in iTerm2. Is there some color compatibility issue or am I missing a dependency?

image
iTerm2
Build 3.5.0beta10
NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Monterey
  use ({"ziontee113/color-picker.nvim",
      config = function()
          require("color-picker")
      end,
  })
-- setup color-picker
local opts = { noremap = true, silent = true }

vim.keymap.set("n", "<C-c>", "<cmd>PickColor<cr>", opts)
vim.keymap.set("i", "<C-c>", "<cmd>PickColorInsert<cr>", opts)

require("color-picker").setup({ -- for changing icons & mappings
    ["icons"] = { "█", "▌" },
    ["border"] = "rounded", -- none | single | double | rounded | solid | shadow
    ["keymap"] = { -- mapping example:
        ["U"] = "<Plug>ColorPickerSlider5Decrease",
        ["O"] = "<Plug>ColorPickerSlider5Increase",
    },
    ["background_highlight_group"] = "Normal", -- default
    ["border_highlight_group"] = "FloatBorder", -- default
  ["text_highlight_group"] = "Normal", --default
})

vim.cmd([[hi FloatBorder guibg=NONE]]) -- if you don't want weird border background colors around the popup.
wilfredjonathanjames commented 1 year ago

I've found that setting termguicolors restores the color preview, but this breaks my theme

ziontee113 commented 1 year ago

Hi @wjagodfrey, it seems that the issue is related to your colorscheme interaction with Neovim.

https://github.com/neovim/neovim/issues/8352

In my case, if I set notermguicolors, my colorscheme breaks completely. I'm pretty sure termguicolors option is a must have to display colors with color-picker.nvim

wilfredjonathanjames commented 1 year ago

Thanks @ziontee113 , that makes sense. I don't think I can be bothered fixing my colourscheme to get this working so I'll leave it for now, but that's good to know. Cheers.