pastel

A command-line tool for generating, analyzing, converting, and manipulating colors.

pastel is a terminal tool for working with colors. You can parse colors in a huge variety of formats, convert between them, mix them, generate palettes, and view them directly in the terminal using true color backgrounds — all without leaving the command line.

Features

  • Parses colors in many formats: hex (#ff6347), RGB, HSL, CSS named colors, and more
  • Converts between color spaces (RGB, HSL, HSV, CIELAB, CIEXYZ, CIELCH)
  • Displays a true-color swatch of any color directly in the terminal
  • Mixes two or more colors together at configurable ratios
  • Generates harmonious color palettes (complementary, triadic, analogous, etc.)
  • Shows contrast ratio between two colors (useful for accessibility checking)
  • Pipes cleanly — output from one pastel command can feed into another

Installation

cargo install pastel

Or via package manager:

# Debian / Ubuntu
apt install pastel

# Fedora
dnf install pastel

# macOS
brew install pastel

# Arch Linux
pacman -S pastel

Usage

# Display a color swatch in the terminal
pastel paint tomato

# Convert a hex color to HSL
pastel format hsl '#e8673c'

# Mix two colors
pastel mix '#e8673c' '#1a1a2e'

# Show the color's lightness, saturation, hue, etc.
pastel color steelblue

# Generate a complementary palette
pastel complementary '#e8673c'

# Check contrast ratio between two colors (WCAG)
pastel textcolor '#e8673c'

# Chain commands — darken a color then show it
pastel darken 0.2 '#e8673c' | pastel paint

Why pastel?

If you spend time designing color schemes for terminals, websites, or editors, pastel eliminates the need to switch to a browser-based color picker. Everything happens in the terminal, and the pipeline-friendly design means you can compose complex color operations from simple building blocks.