uga-rosa / ccc.nvim Goto Github PK
View Code? Open in Web Editor NEWColor picker and highlighter plugin for Neovim.
License: MIT License
Color picker and highlighter plugin for Neovim.
License: MIT License
:CccPick
removes character in front of the color (tested it, it's not spaces, but any character). It also adds alpha by default now.
Both behaviors did not occur in the latest commit from a few days ago.
macOS 12.5.1 (M1)
neovim 0.8.0 (homebrew)
The minimal.vim
file does not work. I removed my entire nvim config, and placed nothing but the linked minimal.vim
file in there. I also removed all plugins from ~/.local/share/nvim/site/pack/packer
. Upon calling :CccPick
it errors: E492: Not an editor command: CccPick
.
So I tried this as minimal config:
opt.termguicolors = true
local ccc = require("ccc")
ccc.setup{}
:CccPick
using the picker should not remove preceding characters.
using the picker removes the preceding character.
After a bunch of trial and error, I could figure out that explicitly disabling LSP for highlighting (highlighter.lsp
set to false) seems to fix this issue.
I'm using plugin for session switching and i noticed after installing ccc.nvim that it fails after session loading.
It seems that the check that the buffer exists is missing.
Possible i can help to fix this issue.
Linux x86
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
https://github.com/coffebar/dotfiles
Open file with color, open color piker, switch session to other project, open other file with color, open color piker for it.
Color piker always opens.
Color picker works in first project, but on second it fails with this error:
Error executing Lua callback: ...m/site/pack/packer/start/ccc.nvim/lua/ccc/utils/init.lua:55: Invalid buffer id: 27
stack traceback:
[C]: in function 'nvim_buf_set_option'
...m/site/pack/packer/start/ccc.nvim/lua/ccc/utils/init.lua:55: in function 'set_lines'
...hare/nvim/site/pack/packer/start/ccc.nvim/lua/ccc/ui.lua:201: in function 'update'
...hare/nvim/site/pack/packer/start/ccc.nvim/lua/ccc/ui.lua:136: in function 'open'
...hare/nvim/site/pack/packer/start/ccc.nvim/plugin/ccc.lua:9: in function <...hare/nvim/site/pack/packer/start/ccc.nvim/plugin/ccc.lua:8>
If reopen nvim on second project again - color picker works. But after switching to other project - it is broken again.
No response
Im almost certain I am doing something wrong.
I can open the floating window with :CccPick
, however if I then :q
, I cannot reopen :CccPick
without restarting neovim. Below is a gif to show this in action. Note: <CR>
does work, but forces an insert of whatever code I have up. If I don't want to insert anything, I would expect the :q
behavior to work as expected.
Im not sure what info would be helpful to you so here is what I could find for "useful" info (what I usually provide in bug reports)
Neovim Info
$ nvim --version
NVIM v0.8.0-dev-1060-g22a88c425
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/miversen/git/neovim/build/cmake.config -I/home/miversen/git/neovim/src -I/home/miversen/git/neovim/.deps/usr/include -I/usr/include -I/home/miversen/git/neovim/build/src/nvim/auto -I/home/miversen/git/neovim/build/include
Compiled by miversen@dev-miversen
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/neovim/share/nvim"
Run :checkhealth for more info
Plugin Info (currently pointing at origin/main HEAD)
$ git rev-parse HEAD
c4861169f26f642cb445dea819faf02f9e2a5ae1
Thoughts? Can I provide anything else useful for you? Am I doing something wrong?
Still getting same error if I am using lazy-loading:
use {
"uga-rosa/ccc.nvim",
config = function()
require("ccc").setup()
end,
cmd = {
"CccPick",
"CccHighlighterEnable",
},
},
E5108: Error executing lua ...vim/site/pack/packer/opt/packer.nvim/lua/packer/load.lua:171: Vim(echomsg):E114: Missing quote: "Error in packer_compiled: ...vim/site/pack/packer/opt/packer.nvim/lua/packer/load.lua:83: Vim:Error executing Lua callback: ...im/site/pack/packer/opt/ccc.nvim/lua/ccc/highlighter.lua:52: a
ttempt to index field 'ft_filter' (a nil value)
stack traceback:
[C]: in function 'cmd'
...vim/site/pack/packer/opt/packer.nvim/lua/packer/load.lua:171: in function <...vim/site/pack/packer/opt/packer.nvim/lua/packer/load.lua:167>
[string ":lua"]:1: in main chunk
Originally posted by @Avimitin in #37 (comment)
The idea would be to use LSP colors support when available (textDocument/documentColor!) or fallback for the default rules.
At moment for this I use document-color.nvim, that is an amazing plugin, but would be nice to use just one plugin for this.
No response
When selecting with visual mode, the highlighting can sometimes mess with the text color, making the highlighted text less readable. Like if the normal text color is white, ccc.nvim
changes the text color to black if its a light color, but then visual mode keeps that dark text color.
Is there some way for a highlight for a specific color string to turn off when visual mode crosses over it?
No response
Follow up to #60.
Right now, highlight.lsp = true
results in adding the alpha even though the color under the cursor does not have alpha when using :CccPick
.
An alpha-slider option like you suggested indeed sounds like a good solution to this:
It would be possible to add option alphaslider to make the display of the alpha slider configurable when the ui is opened. ("auto", "show", "hide").
When attempting to open the color picking menu with :CccPick
it creates an error like below. After hitting enter it opens the menu normally but without color in the selection window.
The problem seems to originate here. The function obviously exist according to this.
I am using branch 0.7.2 of this plugin.
nvim --version
NVIM v0.7.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/x86_64-pc-linux-gnu-gcc -march=znver1 -mtune=znver1 -maes -fstack-protector -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=malloc -Wsuggest-attribute=cold -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/config -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2/src -I/usr/include -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/src/nvim/auto -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/include
Compiled by portage@localhost
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "/etc/vim/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
uname -a
Linux Gentoo 5.18.1-gentoo-r2 #3 SMP PREEMPT_DYNAMIC Sat Jun 18 19:33:04 EDT 2022 x86_64 AMD Ryzen 7 1700 Eight-Core Processor AuthenticAMD GNU/Linux
I did not see any other issues that mentioned this. Thank you!
https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch
No response
not sure whether it counts as a "color space", but there are the terminal color escape codes, which control the color of output on terminals (e.g. \u001b[34m
for blue)
here is a good blogpost detailing how they work: https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html
As far as I can tell, there are multiple implementations (8 colors, 16 colors, 256 colors), though I think the 16 colors cover most use cases already. Color highlighting could take into account whether it's a foreground or a background escape code.
Having support for color escape codes would make work on shell scripts much more convenient
No response
I got another issue. When I set the inputs to be HSL and HSLuv and also set default_color
, switching between mode will make the color disappear and ccc window become small, making the slider disappear, and when its reappear, it doesn't work anymore
Color should be preserved and slider didn't disappear and still working
Color disappear, window become smaller, slider doesn't work and is gone
-- color picker
use {
"uga-rosa/ccc.nvim",
cmd = "CccPick",
config = function()
require("ccc").setup {
default_color = "#40bfbf",
inputs = {
require("ccc.input.hsl"),
require("ccc.input.hsluv"),
},
},
end
}
I would suggest to move the discussion here, so we don't spam/bump the the reddit thread.
First of all thank you for your fast implementation!
Unfortunetely, after updating I run into some problems when using the plugin, even with the default settings.
First I get an error when triggering the command:
Error executing Lua callback: ...hare/nvim/site/pack/packer/start/ccc.nvim/lua/ccc/ui.lua:69: attempt to call field 'nvim_win_set_hl_ns' (a nil value)
stack traceback:
...hare/nvim/site/pack/packer/start/ccc.nvim/lua/ccc/ui.lua:69: in function '_open'
...hare/nvim/site/pack/packer/start/ccc.nvim/lua/ccc/ui.lua:87: in function 'open'
...hare/nvim/site/pack/packer/start/ccc.nvim/plugin/ccc.lua:9: in function <...hare/nvim/site/pack/packer/start/ccc.nvim/plugin/ccc.lua:8>
When I press enter after the error, the picker window opens (with the new before color tooo), but without any colors.
Info The color icons come from "NvChad/nvim-colorizer.lua"
https://www.w3.org/TR/css-color-4/#specifying-lab-lch
No response
Hi @uga-rosa, how are you doing?
It will be nice to have hsluv color space support.
You can "borrow" one from here:
https://github.com/hsluv/hsluv-lua/blob/master/hsluv.lua
fedora x86
neovim 0.8.3
packer.nvim - Total plugins: 10
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Comment.nvim
• ccc.nvim
• gruvbox.nvim
• indent-blankline.nvim
• lualine.nvim
• nvim-colorizer.lua
• nvim-treesitter
• nvim-web-devicons
• packer.nvim
• twilight.nvim
did :PackerCompile with this config
-- PLUGINS --
return require("packer").startup(function(use)
use "wbthomason/packer.nvim"
use {
"uga-rosa/ccc.nvim",
config = function()
require("ccc").setup()
end
}
end}
insert multiple hsl or multiple rgb colors in the same line and enable highlighter
detects and highlights colors
only detects and highlights the first color
No response
When starting up neovim I get this error message:
Error detected while processing BufEnter Autocommands for "*":
Error executing lua callback: .../site/pack/packer/start/ccc.nvim/lua/ccc/highlighter.lua:52: attempt to index field 'ft_filter' (a nil value)
stack traceback:
.../site/pack/packer/start/ccc.nvim/lua/ccc/highlighter.lua:52: in function 'enable'
.../site/pack/packer/start/ccc.nvim/lua/ccc/config/init.lua:58: in function <.../site/pack/packer/start/ccc.nvim/lua/ccc/config/init.lua:52>
OS:
Gentoo Linux ~amd64
Neovim version:
NVIM v0.9.0-dev-26-g06f4edc
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
use({
'uga-rosa/ccc.nvim',
config = function()
require('ccc').setup({
highlighter = {
auto_enable = true
}
})
vim.keymap.set('n', ',ct', vim.cmd.CccHighlighterToggle)
vim.keymap.set('n', ',cp', vim.cmd.CccPick)
end
})
Just start neovim with nvim
and the error pops up.
My full config is here just in case ...
No error.
Error detected while processing BufEnter Autocommands for "*":
Error executing lua callback: .../site/pack/packer/start/ccc.nvim/lua/ccc/highlighter.lua:52: attempt to index field 'ft_filter' (a nil value)
stack traceback:
.../site/pack/packer/start/ccc.nvim/lua/ccc/highlighter.lua:52: in function 'enable'
.../site/pack/packer/start/ccc.nvim/lua/ccc/config/init.lua:58: in function <.../site/pack/packer/start/ccc.nvim/lua/ccc/config/init.lua:52>
No response
Whenever I have CCC lazyloaded, Treesitter does not apply. Highlighting, indenting, nothing works.
NixOS Unstable 22.11
Neovim Nightly 0.9.0
Manually place nvim-treesitter in the Start folder and ccc.nvim in the Opt folder in the packpath
local configs = require("nvim-treesitter.configs")
configs.setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
}
}
local onFileOpen = function()
vim.api.nvim_exec(
[[
packadd ccc-nvim
]],
true
)
local ccc = require("ccc")
ccc.setup {
highlighter = {
enable = true
}
}
end
vim.api.nvim_create_autocmd(
{"BufRead","BufNewFile"},
{
callback = onFileOpen
}
)
Treesitter works as usual, with all the normal features, such as highlighting.
Treesitter fails to load. It throws no error messages, but it does nothing.
No response
Even with highlighters.auto_enable
set to true
, the very first buffer (the one with the file given in the command line) does not get highlighted. I'm guessing the BufEnter
event does not fire or it has already fired by the time require("ccc").setup
runs
Arch Linux
NVIM v0.8.0
set termguicolors
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/autoload/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'uga-rosa/ccc.nvim'
Plug 'neovim/nvim-lspconfig'
call plug#end()
PlugInstall | quit
lua <<EOF
local ccc = require("ccc")
local mapping = ccc.mapping
ccc.setup({
highlighter = {auto_enable = true}
})
require("lspconfig").cssls.setup({})
EOF
Suppose you have a file foo.css
, full of CSS colors. Anything will do, say:
html {
color: #ffffff
}
Try to edit the file,
nvim foo.css
The colors in foo.css
get highlighted
The colors do not get highlighted
No response
:CccPick
press <cr>
Should not error
Is throwing error
I just updated ccc.nvim from the main branch and now I'm getting this error whenever I open any file
OS:
macOS 12.6 21G115 arm64
neovim:
NVIM v0.9.0-dev-1214-ge54541f7f-dirty
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]
not sure how to replicate it or what is causing it, i'm using https://github.com/LunarVim/LunarVim and this is my config file https://github.com/Almo7aya/dotfiles/blob/master/.config/lvim/config.lua#L160
opening any file using :e [filename] or by telescope
works fine without any errors
getting: Error executing vim.schedule lua callback: .../site/pack/packer/start/ccc.nvim/lua/ccc/hig
hlighter.lua:118: Invalid buffer id: 1
and it does not go away until I press enter 7 or 8 times
No response
It would be nice to have support for RGBA format (for both the picker and the highlighting). It's literally just RGB with alpha channel, often represented either as #RRGGBBAA
(described in CSS Color Module Level 4) or an int value 0xRRGGBBAA
.
Note that some applications use sRGB so the int would be 0xAARRGGBB
. I don't know how we can distinguish both forms in a buffer without LSP when the user invoke the picker though.
No response
I wrote a picker (link) to colorize any string with setting a table in setup()
.
require("ccc").setup {
picker = {
require "ccc.picker.rgb",
require "core.utils.ccc" {
red = "#BF616A",
green = "#A3BE8C",
blue = "#81A1C1",
……
}
},
}
Can you merge this feature when I issue it as a PR?
Hi, perhaps your plugin already has internal logic that could be exposed to provide functionality similar to that of NTBBloodbath/color-converter.nvim? What do you think?
Syntax errors in CSS rgb and rgba function parameters trigger plugin module error.
Arch Linux, Linux 6.1.6-arch1-3
NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
set termguicolors
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/autoload/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'uga-rosa/ccc.nvim'
Plug 'neovim/nvim-lspconfig'
call plug#end()
PlugInstall | quit
lua <<EOF
local ccc = require("ccc")
local mapping = ccc.mapping
ccc.setup({
-- Minimal configurations required to reproduce the problem.
highlighter = { auto_enable = true }
})
require("lspconfig").cssls.setup({})
EOF
Create CSS file using rgb() or rgba() CSS functions.
In insert mode add additional excess comma ,
between the function parameters:
.App-header {
background: rgba(0,,0,0,0);
}
Continue typing in insert mode.
Or save and open a file with this CSS syntax error.
No module errors triggered.
Error message:
Error executing vim.schedule lua callback: /tmp/plugged/vim-plug/ccc.nvim/lua/ccc/highlighter.lua:156: bad argument #3 to 'rgb2hex' (number expected, got nil)
stack traceback:
[C]: in function 'rgb2hex'
/tmp/plugged/vim-plug/ccc.nvim/lua/ccc/highlighter.lua:156: in function '_get_or_create_hl'
/tmp/plugged/vim-plug/ccc.nvim/lua/ccc/highlighter.lua:252: in function 'update_picker'
/tmp/plugged/vim-plug/ccc.nvim/lua/ccc/highlighter.lua:148: in function </tmp/plugged/vim-plug/ccc.nvim/lua/ccc/highlighter.lua:146>
Press ENTER or type command to continue
On typing in insert mode. On file load.
No response
Hi uga-rossa, thanks for this lovely color picker plugin! Unfortunately though, I encounter an odd issue. Whenever I'm moving my slider, the border color of the floating window suddenly changes. I've provided the steps here that atleast always consistently result in the same behavior on my machine, also a GIF
the window border color shouldn't change
Window border color changes randomly in some occasion
-- color picker
use {
"uga-rosa/ccc.nvim",
cmd = "CccPick"
}
Would be nice to add a filetype for the pick window, that are useful for customization.
On my case I did create a plugin with common ignored files for certain plugins: ignored_files.vim. One feature is to disable indent plugins for a list of filetypes.
So now the pick window shows like this:
With filetype support would be like this:
Even with highlighters.auto_enable
set to true
, the very first buffer (the one with the file given in the command line) does not get highlighted. I'm guessing the BufEnter
event does not fire or it has already fired by the time require("ccc").setup
runs
Arch Linux
NVIM v0.8.0
set termguicolors
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/autoload/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'uga-rosa/ccc.nvim'
Plug 'neovim/nvim-lspconfig'
call plug#end()
PlugInstall | quit
lua <<EOF
local ccc = require("ccc")
local mapping = ccc.mapping
ccc.setup({
highlighter = {auto_enable = true}
})
require("lspconfig").cssls.setup({})
EOF
Suppose you have a file foo.css
, full of CSS colors. Anything will do, say:
html {
color: #ffffff
}
Try to edit the file,
nvim foo.css
The colors in foo.css
get highlighted
The colors do not get highlighted
No response
:CccPick
Ideally the bindings should continue to work, or the picker closes
Picker stays open and cannot be closed or reactivated
Despite that this plugin is awesome! ❤️
No response
It would be useful there was an option for :CccPick
to automatically preserve the color format under the cursor. So if I trigger the picker while my cursor is on a hex-formatted color, the output should switch to hex, if I trigger it on a hsl-formatted color, the output should switch to hsl automatically.
This would be very useful when you regularly work with different color formats.
(I am unsure whether this is maybe already possible with the plugin? At least I didn't figure out how to do this after reading the full docs.)
No response
It's more comfortable, at least with some configuration like autoclose
or something like that, it could also be nice to add to the default mappings to close the window with <esc>
.
No response
modern css color notation leaves out the commas for rgb
and hsl
and the like.
I would like a way to define new output mode, for example, (R,G,B)
without the RGB at the front.
https://bottosson.github.io/misc/colorpicker/
HSV support would be really nice, I personally find them a lot more intuitive than HSL.
If possible OKHSV would be a superior choice (blog post explaining the differences: https://bottosson.github.io/posts/colorpicker/), but I haven't seen any Lua implementation so there might be a need to write it from a scratch.
:CccPick
does not work anymore
macOS 13.2.1 (M1)
neovim 0.8.3 (homebrew)
Neovide 0.10.3 (homebrew)
I used the provided minimal.vim
with no config changes.
:CccHighlightEnable
etc. works, :CccPick
does not.
:CccPick
the color picker should work
every time I run :CccPick
, I get this, regardless of the config. Whether I use minimal.vim
or my own config, the result is the same.
With the previous commit d17dabd
, everything works.
Sorry, but a lot of things are broken as a result of the extensive renovations.
Avoid update.
I found that when I set the auto_enable option and filetypes, then the CccHighlighterToggle
command will not work anymore
this is my configuration for that:
return { "uga-rosa/ccc.nvim",
cmd = {
'CccHighlighterToggle',
"CccPick",
"CccConvert",
},
ft = { 'css', 'html' },
config = function(plugin)
local ccc = require("ccc")
local mapping = ccc.mapping
ccc.setup {
highlighter = {
auto_enable = true,
filetypes = plugin.ft,
},
mappings = {
j = mapping.decrease1,
h = mapping.toggle_input_mode,
i = 'k',
}
}
end,
}
it will auto-enable when I open a new HTML and CSS file, but in a Lua file , I try to use CccHighlighterEnable
, it doesn't work
CccPicker is still working...
so I have to change my configuration for that now, for example:
return {
"uga-rosa/ccc.nvim",
cmd = {
'CccHighlighterToggle',
"CccPick",
"CccConvert",
},
ft = { 'css', 'html' },
config = function(plugin)
local ccc = require("ccc")
local mapping = ccc.mapping
ccc.setup {
mappings = {
j = mapping.decrease1,
h = mapping.toggle_input_mode,
i = 'k',
}
}
vim.api.nvim_create_autocmd('Filetype', {
patten = plugin.ft,
command = 'CccHighlighterEnable'
})
end,
}
Ubuntu22.04LTS, kitty latest version
just as the description saying
set auto_enable filetypes then try to use the CccHighlighterEnable command
The CccHighlighterEnable command should add highlights in the current buffer
nothing is changed
nop
Hi @uga-rosa,
Sorry for the question but having searched through similar issues, most closely related of which is #14. I couldn't/cannot get this plugin to stop highlighting any numbers preceded by a # e.g. #236
for example which could be a PR or issue number on GH and not a hex color. In general I don't want it highlight any hex colors that aren't >= 6.
I tried using the exclude_pattern
option mentioned in that issue (it's undocumented btw, just mentioning so you're aware) for example:
hex = {
'%s#%x%x%x%s+',
'[%w_]#%x%x%x',
'[%w_]#%x%x%x%x%x%x',
},
but the following text in a lua
file with the highlighter enable still highlights -- partial fix for #391
the #391
is still highlighted unfortunately.
I'm pretty sure that lua pattern works as I've tested that it would match the pattern but it doesn't stop the highlighting.
https://www.w3.org/TR/css-color-4/#the-hwb-notation
No response
Hi 👋🏿,
Just been trying this plugin out as an alternative to colorizer
and it seems really cool so far. One strange issue I've noticed though is that the colour of my lsp floating window and of CccNormalFloat
itself are different from what I set as my NormalFloat
e.g.
With ccc.nvim installed, notice the border is dark, but the background of the text is not.
My normal float colour however is unchanged.
Without ccc.nvim I get which is expected.
The CccPick
window itself also seems to ignore my settings for NormalFloat
and even setting CccFloatNormal
makes no difference
I'm not sure how highlights are being applied, e.g. using namespaces, but it seems to be leaking into other areas somehow.
My ccc config is:
use({
'uga-rosa/ccc.nvim',
config = function()
local ccc = require('ccc')
ccc.setup({
pickers = {
ccc.picker.hex,
ccc.picker.css_rgb,
ccc.picker.css_hsl,
},
win_opts = { border = as.style.current.border }, -- var representing some custom border chars
highlighter = {
auto_enable = true,
excludes = { 'dart' },
},
})
end,
})
When i try to :CccPick it returns this:
Don't know what to do.
Windows 11 using Wsl2 with Ubuntu 20.04
Could not make it work using minimal config provide in example
Enter command mode and using CccPick
Open ColorPick
Gives an error
No response
After update today get an error in 0.7.2 branch:
Error detected while processing /home/dmytro/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ...re/nvim/site/pack/packer/start/ccc.nvim/lua/ccc/init.lua:2: module 'ccc.highlighter' not found:
no field package.preload['ccc.highlighter']
no file './ccc/highlighter.lua'
no file '/usr/share/luajit-2.1.0-beta3/ccc/highlighter.lua'
no file '/usr/local/share/lua/5.1/ccc/highlighter.lua'
no file '/usr/local/share/lua/5.1/ccc/highlighter/init.lua'
no file '/usr/share/lua/5.1/ccc/highlighter.lua'
no file '/usr/share/lua/5.1/ccc/highlighter/init.lua'
no file './ccc/highlighter.so'
no file '/usr/local/lib/lua/5.1/ccc/highlighter.so'
no file '/usr/lib64/lua/5.1/ccc/highlighter.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './ccc.so'
no file '/usr/local/lib/lua/5.1/ccc.so'
no file '/usr/lib64/lua/5.1/ccc.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
...re/nvim/site/pack/packer/start/ccc.nvim/lua/ccc/init.lua:2: in main chunk
[C]: in function 'require'
/home/dmytro/.config/nvim/lua/user/ccc.lua:1: in main chunk
[C]: in function 'require'
/home/dmytro/.config/nvim/init.lua:23: in main chunk
Error detected while processing /home/dmytro/.local/share/nvim/site/pack/packer/start/ccc.nvim/plugin/ccc.lua:
E5113: Error while calling lua chunk: ...hare/nvim/site/pack/packer/start/ccc.nvim/plugin/ccc.lua:6: loop or previous error loading module 'ccc'
stack traceback:
[C]: in function 'require'
...hare/nvim/site/pack/packer/start/ccc.nvim/plugin/ccc.lua:6: in main chunk
Packer: use {'uga-rosa/ccc.nvim', branch = '0.7.2'}
with default settings
Nvim: 0.7.2, Fedora 36
Yesterday it works good, the problem appear after update today.
If return to main branch, plugin doesn't work
Really interesting plugin, great work!
I frequently tend to prefer HSV over HSL when tweaking colors, as - opposed to the Lightness component in HSL - the Value component of HSV better preserves chroma. Would you be willing to support the HSV color model in your plugin?
Image source: Wikipedia - HSL and HSV
given this:
event = "BufRead",
config = 'require "plugin.ccc"',
with doesn't work I mean the highlighter, config:
highlighter = {
auto_enable = true,
},
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.