Pastel is a new free and open source command line tool to work with colors / perform various color operations. It's written in Rust, and it can convert colors from one format to another, show and analyze colors on the terminal, generate a set of visually distinct colors, and there's even a color picker, along with much more.
The tool has support for many different color formats and color spaces, including RGB, HSL, CIELAB, CIELCh as well as ANSI 8-bit and 24-bit representations.
Available Pastel subcommands:
color
: Display information about the given colorlist
: Show a list of available color namesrandom
: Generate a list of random colorsdistinct
: Generate a set of visually distinct colors by maximizing the perceived color difference between pairs of colorssort-by
: Sort a list of colors by the given propertypick
: Interactively pick a color from the screen (pipette)format
: Convert the given color(s) to a specific formatpaint
: Print colored text using ANSI escape sequencesgradient
: Generate a sequence of colors that interpolates between 'start' and 'stop'. The interpolation is performed in the specified color spacemix
: Create new colors by interpolating between two colors in the given colorspacesaturate
: Increase color saturation by a specified amountdesaturate
: Decrease color saturation by a specified amountlighten
: Lighten color by a specified amountdarken
: Darken color by a specified amountrotate
: Rotate the hue channel by the specified anglecomplement
: Get the complementary color (hue rotated by 180°)gray
: Create a gray tone from a given lightnessto-gray
: Completely desaturate a color (preserving luminance)textcolor
: Return a readable foreground text color (either black or white) for a given background color. This can also be used in the opposite way, i.e. to create a background color for a given text color.
It's worth noting that for the color picker command to work (
pastel pick
), you'll need to have an external color picker installed, users being able to choose from gpick, xcolor, grabc, colorpicker and chameleon.You may also like: 179 Color Schemes For Your Gtk-Based Linux Terminal (Gnome Terminal, Tilix, Xfce Terminal, More)
A few Pastel examples, with screenshots: