Pastel: A Command-Line Swiss Army Knife for Colors
Ever found yourself tweaking a color palette in a terminal-based workflow, only to wish you had a quick way to generate, convert, or analyze colors without leaving the command line? Enter Pastel, a versatile CLI tool that makes color manipulation as easy as piping commands together.
Built by sharkdp (the same developer behind bat and fd), Pastel is designed for developers, designers, and anyone who works with colors programmatically. Whether you’re scripting UI themes, analyzing contrast ratios, or just need a quick way to convert HEX to HSL, Pastel has you covered.
What It Does
Pastel is a command-line utility that lets you:
- Generate random colors or pick from predefined ones
- Convert between formats (HEX, RGB, HSL, CIELAB, ANSI codes, and more)
- Manipulate colors (lighten, darken, saturate, mix, blend)
- Analyze color properties (contrast, readability, perceived brightness)
It’s like jq for colors—small, composable, and designed to fit into Unix pipelines.
Why It’s Cool
- Color Space Savvy: Unlike basic converters, Pastel supports advanced spaces like CIELAB and CIELCh, which better match human perception.
- Terminal-Friendly: Outputs ANSI-colored text for instant previews, making it great for shell scripts or documentation.
- Composable by Design: Pipe commands like
pastel random | pastel mix blue | pastel lighten 0.1to create dynamic palettes. - Smart Features: Need to check if text is readable on a background?
pastel contrastcalculates WCAG compliance.
How to Try It
Install via cargo (Rust required):
cargo install pastel
Or grab a pre-built binary from the releases page.
Quick demo:
pastel random | pastel format hex rgb hsl # Get a random color in multiple formats
pastel paint magenta -- "Hello, world!" # Print magenta text in your terminal
Final Thoughts
Pastel is one of those tools you didn’t know you needed until you start using it. It’s perfect for automating color-related tasks, debugging CSS, or even generating themes for terminal apps. The composability means it slots right into existing workflows—no GUI required.
If you’re tired of hopping between color pickers and converters, give Pastel a spin. It might just become your new CLI color companion.
Follow @githubprojects for more cool tools like this.