Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

sharkdp/pastel

A command-line tool to generate, analyze, convert and manipulate colors

sharkdp/pastel.json
{
"createdAt": "2019-06-02T16:04:32Z",
"defaultBranch": "master",
"description": "A command-line tool to generate, analyze, convert and manipulate colors",
"fullName": "sharkdp/pastel",
"homepage": "",
"language": "Rust",
"name": "pastel",
"pushedAt": "2025-11-09T21:36:42Z",
"stargazersCount": 6059,
"topics": [
"cli",
"color-converter",
"color-space",
"colors",
"command-line",
"rust",
"terminal",
"tool"
],
"updatedAt": "2025-11-25T15:56:47Z",
"url": "https://github.com/sharkdp/pastel"
}

Build Status

pastel is a command-line tool to generate, analyze, convert and manipulate colors. It supports many different color formats and color spaces like RGB (sRGB), HSL, CIELAB, CIELCh as well as ANSI 8-bit and 24-bit representations.

![pastel in action]!(doc/pastel.gif)

pastel provides a number of commands like saturate, mix or paint. To see a complete list, you can simply run

Terminal window
pastel

To get more information about a specific subcommand (say mix), you can call pastel mix -h or pastel help mix.

Many pastel commands can be composed by piping the output of one command to another, for example:

Terminal window
pastel random | pastel mix red | pastel lighten 0.2 | pastel format hex

Colors can be specified in many different formats:

lightslategray
'#778899'
778899
789
'rgb(119, 136, 153)'
'119,136,153'
'hsl(210, 14.3%, 53.3%)'

Colors can be passed as positional arguments, for example:

pastel lighten 0.2 orchid orange lawngreen

They can also be read from standard input. So this is equivalent:

printf "%s\n" orchid orange lawngreen | pastel lighten 0.2

You can also explicitly specify which colors you want to read from the input. For example, this mixes red (which is read from STDIN) with blue (which is passed on the command line):

pastel color red | pastel mix - blue

Converting colors from one format to another

Section titled “Converting colors from one format to another”
Terminal window
pastel format hsl ff8000
Terminal window
pastel color "rgb(255,50,127)"
pastel color 556270 4ecdc4 c7f484 ff6b6b c44d58
Terminal window
pastel pick

Generate a set of N visually distinct colors

Section titled “Generate a set of N visually distinct colors”
pastel distinct 8
Terminal window
pastel list
Terminal window
pastel format name 44cc11
Terminal window
bg="hotpink"
fg="$(pastel textcolor "$bg")"
pastel paint "$fg" --on "$bg" "well readable text"
Terminal window
pastel paint -n black --on red --bold " ERROR! "
echo " A serious error"
pastel paint -n black --on yellow --bold " WARNING! "
echo " A warning message"
pastel paint -n black --on limegreen --bold " INFO "
echo -n " Informational message with a "
echo -n "highlighted" | pastel paint -n default --underline
echo " word"

You can download the latest Debian package from the release page and install it via dpkg:

Terminal window
wget "https://github.com/sharkdp/pastel/releases/download/v0.11.0/pastel_0.11.0_amd64.deb"
sudo dpkg -i pastel_0.11.0_amd64.deb

Alternatively, pastel is available in the official Debian repositories (currently in testing and unstable):

Terminal window
sudo apt update
sudo apt install pastel

You can install pastel from the Extra repositories:

sudo pacman -S pastel

You can install pastel from the Nix package:

nix-env --install pastel

You can install pastel via Homebrew

brew install pastel

You can install pastel via Scoop

scoop install pastel

You can install pastel via Winget:

Terminal window
winget install sharkdp.pastel

Get it from the Snap Store:

sudo snap install pastel

Using the package manager:

pkgin install pastel

From source:

cd /usr/pkgsrc/graphics/pastel
make install

Check out the release page for binary builds.

If you do not have cargo, install using rust’s installation documentation.

If you have Rust 1.83 or higher, you can install pastel from source via cargo:

cargo install pastel

Alternatively, you can install pastel directly from this repository by using

git clone https://github.com/sharkdp/pastel
cargo install --path ./pastel

Interesting Wikipedia pages:

Color names:

Maximally distinct colors:

Other articles and videos:

Licensed under either of

at your option.