Skip to content

A graphical color picker for Neovim in Oklch color space

License

Notifications You must be signed in to change notification settings

eero-lehtinen/oklch-color-picker-0.nvim

 
 

Repository files navigation

OKLCH Color Picker (for Neovim)

Forked from https://github.com/evilmartians/oklch-picker, stuffed into an electron app, and modified into a Neovim plugin.

Screenshot_20240906_010725

Features

  • Choose a color from your buffer and edit it in a graphical editor
  • Works only with hex colors for now (e.g. #RRGGBB, short form and alpha also supported)
  • Picker uses the Oklch colorspace
  • Blazing fast Note: Satisfaction not guaranteed. The first launch takes 2-6 seconds. After use it's not closed, but only hidden to avoid paying for slow startup multiple times. Sockets are used to coordinate the next picking. Memory usage is only about 1.5G. The same picker instance can be used for multiple Neovim instances.

brenoprata10/nvim-highlight-colors is a good companion for this plugin.

Installation

Node.js and npm are required.

lazy.nvim

{
  'eero-lehtinen/oklch-color-picker-0.nvim',
  build = 'npm install && npm run build',
  opts = {},
},

Use :ColorPickOklch0 to pick a color under cursor, or call

require('oklch-color-picker-0').pick_color_under_cursor()

Keymaps you have to setup yourself, e.g.

vim.keymap.set('n', '<leader>p', require('oklch-color-picker-0').pick_color_under_cursor)

Default Options

{
  -- Minimize to tray after usage (set to false to minimize to taskbar)
  use_tray = true,
  -- What level of notifications to emit
  log_level = vim.log.levels.INFO,
}

Other similar plugins

About

A graphical color picker for Neovim in Oklch color space

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • TypeScript 69.1%
  • CSS 18.6%
  • Pug 6.4%
  • Lua 3.7%
  • JavaScript 1.7%
  • HTML 0.4%
  • Shell 0.1%