pastel
Show, inspect, and manipulate colors
TLDR
Convert colors from one format to another. Here from RGB to HSL
Show and analyze colors on the terminal
Pick a color from somewhere on the screen
Generate a set of N visually distinct colors
List all X11/CSS color names
SYNOPSIS
pastel [OPTIONS] SUBCOMMAND [ARGS...]
pastel operates via subcommands, each performing a specific color-related task.
Common invocation examples:
pastel color COLOR [...]
pastel convert COLOR
pastel gradient COLOR1 COLOR2 [STEPS]
pastel pick
pastel random [N]
pastel lighten FACTOR COLOR [...]
pastel blend COLOR1 COLOR2
PARAMETERS
--output <FORMAT> | -o <FORMAT>
Specifies the desired output format for colors (e.g., hex, rgb, hsl, lch, ansi). Available with many subcommands.
--raw | -r
Outputs raw color values without ANSI escape codes, comments, or additional formatting. Useful for scripting.
--rgb-space <SPACE>
Defines the RGB color space for certain operations (e.g., srgb, display-p3). Affects how RGB values are interpreted.
--lightness-space <SPACE>
Specifies the lightness space (e.g., lch, oklch, lab, oklab) for operations like lighten or darken. Different spaces perceive lightness differently.
--hue-space <SPACE>
Determines the hue space (e.g., lch, oklch, hsl, hwb) for operations such as rotate. Influences how hue adjustments are made.
--seed <VALUE>
Provides a seed for pseudo-random number generation, ensuring reproducible results for commands like random.
DESCRIPTION
pastel is a versatile command-line utility for working with colors. It allows users to parse, convert, generate, and manipulate colors directly from the terminal. Supporting various color spaces like RGB, HSL, LCh, Lab, OkLab, and OkLCh, pastel can read colors from input arguments or standard input. Its extensive set of subcommands enables operations such as creating gradients, blending colors, finding distinct colors, random color generation, and adjusting saturation, lightness, and hue. It's an indispensable tool for developers, designers, and anyone needing to interact with color data in a scripting or command-line environment, providing precise control and a wide range of output formats including hexadecimal, RGB, HSL, and ANSI escape codes for terminal display.
CAVEATS
pastel's extensive subcommand structure, while powerful, can require some initial learning to navigate its many functionalities and specific options. Accurate color representation in the terminal depends heavily on the terminal's capabilities and its support for true color (24-bit) ANSI escape codes.
PIPING AND SCRIPTING CAPABILITIES
pastel is designed to integrate seamlessly into command-line workflows. It can read colors from standard input and output results to standard output, making it highly suitable for piping with other utilities like grep, awk, or sed. This allows for complex color manipulation and processing within shell scripts, automating tasks like generating color palettes, adjusting themes, or dynamically coloring terminal output.
HISTORY
pastel was created by Daniel P. Luppi (@sharkdp), known for developing other popular command-line utilities like bat and fd. Written in Rust, it debuted around late 2019/early 2020, aiming to provide a robust and feature-rich color manipulation tool with strong support for modern color spaces and reliable parsing, a gap previously present in many CLI ecosystems. Its development has been active, continually adding new subcommands and improving color handling.
SEE ALSO
colord(1), xcolor(1), printf(1)