A Neovim plugin for color management, palette generation, and color highlighting. Generate color palettes from 500+ predefined colors, manage palettes, and highlight colors in your code with ease.
- 🎨 Color Palette Generation: Generate palettes from 500+ predefined colors using various methods
- 📋 Palette Management: Save, load, rename, delete, and export palettes
- 🌈 Color Highlighting: Highlight colors in your buffers with a name hint
- 🔍 Color Pickers: Both telescope and grid-based color selection interfaces
- 📊 Palette Statistics: Get insights about your saved palettes
- 🎯 Intelligent Interface: Easy-to-use floating windows with keyboard shortcuts
- ♿ Accessibility Analysis: WCAG compliance checking for color contrast
- 💾 Persistent Storage: Palettes saved to file for future sessions
- 💡 Completion: Easy integration with nvim-cmp plugin.
| Integration | Status | Description |
|---|---|---|
| ✅ Supported | Color name completion | |
| ✅ Supported | Fuzzy color picker |
Using lazy.nvim
{
"llawn/colors.nvim",
dependencies = {
"nvim-telescope/telescope.nvim", -- optional, for telescope picker
},
config = function()
require("colors").setup({
-- your configuration here
})
end
}Using vim.pack (Neovim 0.12+)
local gh = function(x) return 'https://github.com/' .. x end
vim.pack.add(gh('llawn/colors.nvim'))
vim.pack.add(gh('nvim-telescope/telescope.nvim')) -- optional, for telescope picker
require("colors").setup({
-- your configuration here
}){
highlighting = {
enabled = true,
max_lines = 5000, -- Maximum lines to process for performance
enable_virtual_text = true,
enable_background_highlights = true,
},
-- Palette file settings
palette = {
file_path = vim.fn.stdpath("data") .. "/palettes.lua",
},
-- Key mappings
keymaps = {
toggle_highlight = "<leader>ct",
palette_list = "<leader>cl",
palette_stats = "<leader>cs",
hex_colors = "<leader>cc",
grid_picker = "<leader>cC",
},
-- Autocommand settings
autocmds = {
events = { "BufEnter", "BufRead", "TextChanged", "TextChangedI" },
pattern = "*",
},
}require("colors").setup({
highlighting = {
enabled = true,
max_lines = 3000,
enable_virtual_text = false,
},
keymaps = {
toggle_highlight = "<leader>th",
palette_list = "<leader>pl",
hex_colors = "<leader>hc",
}
})Or see Example for colors.nvim
enabled(boolean): Enable/disable color highlightingmax_lines(number): Maximum lines to process per buffer (performance)enable_virtual_text(boolean): Show color name hintsenable_background_highlights(boolean): Apply background colors
toggle_highlight(string): Toggle color highlightingpalette_list(string): Open palette listpalette_stats(string): Show palette statisticshex_colors(string): Open telescope color pickergrid_picker(string): Open grid color picker
file_path(string): Path to palette storage file
events(table): Events that trigger highlightingpattern(string): File pattern for autocommands
| Command | Description |
|---|---|
:PaletteGenerate [color] [method] [count] |
Generate and display a color palette |
:PaletteList |
List and manage saved palettes |
:PaletteStats |
Show palette collection statistics |
:ColorToggle |
Toggle hex color highlighting |
:HexColors |
Open telescope color picker |
:ColorPick2D |
Open 2D grid color picker |
:PaletteGenerate red monochromatic 5
:PaletteGenerate blue equally 4
:PaletteGenerate purple analogous 8
:PaletteGenerate "carbon black" monochromatic 5
:PaletteGenerate "electric blue" analogous 6- Monochromatic: Variations of a single color (variation of hue)
- Analogous: Colors adjacent on the color wheel (variation of lightness)
- Equally: Colors evenly spaced on the color wheel (variation of hue)
Color names with spaces must be enclosed in quotes
- Open palette list:
<leader>clor:PaletteList - In palette list:
l- Load selected palettee- Export palette to clipboard (Lua Format)r- Rename paletted- Delete paletteq- Close list
When viewing a palette:
l- Back to palette liste- Export palette to clipboard (Lua format)d- Delete current paletter- Rename current palettea- Check accessibility (WCAG compliance)q- Quit menu
:ColorToggle
" or with keymap: <leader>ct:lua require("colors.api").refresh_highlight()
:HexColors
" or with keymap: <leader>cc
:ColorPick2D
" or with keymap: <leader>cC:PaletteStats
" or with keymap: <leader>cs
colors.nvim provides an nvim-cmp source for color name completion with documentation and hex values.
Add the colors source to your nvim-cmp configuration:
-- Add in your nvim-cmp config
require("colors.cmp_colors").setup()
cmp.setup({
sources = cmp.config.sources({
{ name = "colors" },
}),
formatting = {
format = function(entry, vim_item)
vim_item = cmp_colors.format(entry, vim_item)
return vim_item
end,
},
})
cmp.setup.cmdline(":", {
sources = cmp.config.sources({
{ name = "palette_colors" },
}),
})See Example for a complete examples.
Palettes are stored in Lua format at vim.fn.stdpath("data") .. "/palettes.lua" by default. Each palette includes:
{
colors = { 0xFF0000, 0x00FF00, 0x0000FF, ... }, -- Color values
metadata = {
method = "complementary",
base_color = "red",
options = {},
created_at = "2026-01-01 12:00:00",
color_count = 5
}
}If you find this plugin helpful, consider giving it a ⭐ on GitHub!
