- LSP
textDocument/documentColoris supported (Requires neovim built-in LSP client).
- Many color formats conforming to CSS Color Module level4 can be highlighted without LSP.
- Advanced settings
- See wiki
Create Color Code in neovim.
Super powerful color picker plugin.
-
Features
- No dependency.
- RGB, HSL, CMYK, and other color space sliders for color creation.
- Dynamic highlighting of sliders.
- Restore previously used colors.
- Selectable output formats.
- Transparent slider for css functions (e.g.
rgb(),hsl()) - Fast colorizer.
-
Requirements
- neovim 0.8+
If you do not change the default setting, there is no need to call setup.
See ccc-option in doc for the options that can be used.
You can see the default options here.
-- Enable true color
vim.opt.termguicolors = true
local ccc = require("ccc")
local mapping = ccc.mapping
ccc.setup({
-- Your favorite settings
})This plugin provides five commands and one mapping.
-
:CccPick- Detects and replaces the color under the cursor.
- Detectable formats are defined in
ccc-option-pickers(See doc). - If nothing is detected, the color is inserted at a cursor position.
-
<Plug>(ccc-insert)- Defined in insert mode.
- Insert the color without detection.
-
:CccConvert- Convert color formats directly without opening the UI.
- The conversion rules are defined in
ccc-option-convert.
-
:CccHighlighterToggle -
:CccHighlighterEnable -
:CccHighlighterDisable- Highlight colors in the buffer.
- The colors to be highlighted are those returned by textDocument/documentColor request or those registered in
ccc-option-pickers. - Highlight is managed on a buffer-by-buffer basis, so you must use this command each time to enable highlight on a new buffer.
- You can use
ccc-option-highlighter-auto-enableto enable automatically onBufEnter. - The following options are available.
ccc-option-highlighter-auto-enableccc-option-highlighter-filetypesccc-option-highlighter-excludesccc-option-highlighter-lsp
All actions have been implemented as lua functions.
To customize, use ccc-option-mappings.
local ccc = require("ccc")
local mapping = ccc.mapping-
complete
- Default mapping:
<CR> - Close the UI and perform a replace or insert.
- If open the previous colors pallet, select the color under the cursor.
mapping.complete()
- Default mapping:
-
quit
- Default mapping:
q - Alias of
:quit. - Cancel and close the UI without replace or insert.
mapping.quit()
- Default mapping:
-
toggle_input_mode
- Default mapping:
i - Toggle input mode. See
ccc-option-inputsin doc. mapping.toggle_input_mode()
- Default mapping:
-
toggle_output_mode
- Default mapping:
o - Toggle output mode. See
ccc-option-outputsin doc. mapping.toggle_output_mode()
- Default mapping:
-
toggle_alpha
- Default mapping:
a - Toggle show/hide alpha (transparency) slider.
- Transparency is used only when output mode is
css_rgborcss_hsl. mapping.toggle_alpha()
- Default mapping:
-
toggle_prev_colors
- Default mapping:
g - Toggle show and hide the previous colors pallet.
mapping.toggle_prev_colors()- Use the following to move colors.
goto_nextgoto_prevgoto_tailgoto_head
- Default mapping:
-
goto_next
- Default mapping:
w - Go to next (right) color.
mapping.goto_next()
- Default mapping:
-
goto_prev
- Default mapping:
b - Go to previous (left) color.
mapping.goto_next()
- Default mapping:
-
goto_tail
- Default mapping:
W - Go to the last color.
mapping.goto_next()
- Default mapping:
-
goto_head
- Default mapping:
B - Go to the first color.
mapping.goto_next()
- Default mapping:
-
increase
- Default mapping:
l/d/,(1 / 5 / 10) - Increase the value times delta of the slider.
- The delta is defined each color system, e.g. RGB is 1.
mapping.increase1()mapping.increase5()mapping.increase10()ccc.delta(integer)
- Default mapping:
-
decrease
- Default mapping:
h/s/m(1 / 5 / 10) - Decrease the value times delta of the slider.
- The delta is defined each color system, e.g. RGB is 1.
mapping.decrease1()mapping.decrease5()mapping.decrease10()ccc.delta(integer)
- Default mapping:
-
set
- Default mapping:
H/M/L(0 / 50 / 100),1-9(10% - 90%) - Set the value of the slider as a percentage.
mapping.set0()mapping.set50()mapping.set100()ccc.set_percent(integer)
- Default mapping:
See awesome-neovim#color.




