Skip to content

Repository files navigation

OKLCH Color Picker

Crates.io

screenshot

Try the web demo: https://oklch.eerolehtinen.fi/

NOTE: This is an application, even though crates.io detects it as a library. The "library" part only exposes lua bindings for color parsing in Neovim.

Features

  • Takes an input color as a cli argument and outputs the edited color to stdout
  • Uses a perceptual colorspace (OKLCH) to allow intuitive editing
  • Supports many color formats for input and output (editing uses only OKLCH):
    • Hex (#RGB, #RGBA, #RRGGBB, #RRGGBBAA)
    • Other common CSS formats (rgb(..), hsl(..), oklch(..))
    • Hex literal (0xRRGGBB, 0xAARRGGBB)
    • Any list of 3 or 4 numbers can be used as a color (e.g. 0.5, 0.5, 0.5 or 120, 120, 120, 255)
  • Hardware accelerated for maximum smoothness and high resolutions

COLOR ACCURACY NOTE: This application doesn't properly interpret display color gamuts wider than sRGB. E.g., if your display uses Display P3 (common with Apple devices) or Adobe RGB, this application shows colors more vibrantly than intended.

Installation

Download from Releases.

If you have cargo, you can also install with:

cargo install oklch-color-picker --locked

Convert a color without opening the picker with --convert-to:

oklch-color-picker "oklch(62% 0.2 250)" --convert-to hex

The input format is auto-detected when possible. Use --format for ambiguous raw values:

oklch-color-picker "0.62, 0.2, 250" --format raw_oklch --convert-to rgb

Check out the neovim plugin that this picker was made for eero-lehtinen/oklch-color-picker.nvim.

Inspired by https://oklch.com/.

About

A standalone color picker application using the Oklch colorspace (based on Oklab)

Topics

Resources

Stars

58 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages