CLI tool
sharkdp/pastel avatar
sharkdp/pastel

sharkdp/pastel: a command-line colour toolbox for terminals and scripts

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

6,510 stars133 forksRustApache-2.0

At a glance

What is it?
pastel is a Rust CLI that converts, generates and manipulates colours across RGB, HSL, CIELAB, CIELCh and ANSI formats. It is most useful when colour decisions have to happen inside a shell pipeline.
Who is it for?
Adopt pastel if you convert or generate colours inside shell scripts, CI checks or terminal tooling and want one binary that speaks RGB, HSL, CIELAB, CIELCh and ANSI. Do not adopt it if you need a GUI colour picker with a persistent palette file, or if your workflow is entirely inside a design application.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 152 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What pastel solves and who reaches for it

Colour work in a terminal usually means copying hex codes between a browser, a stylesheet and a script. pastel removes that round trip. The README describes it as a command-line tool to generate, analyze, convert and manipulate colors, and the subcommand list backs that up: saturate, mix, lighten, format, distinct, pick, paint, list. Each one reads colour values from arguments or standard input and writes a colour value to standard output. That makes it a filter rather than an application. The intended user is someone writing shell scripts, terminal themes, CI checks or documentation who needs a colour transformed and does not want to open a design tool. It is not a palette manager and it does not persist state between invocations.

How the colour pipeline works

The core design is composition through pipes. A command such as random produces a colour, mix combines it with another, lighten shifts lightness, and format renders the result in a named output format. The README gives exactly this chain:

bash
pastel random | pastel mix red | pastel lighten 0.2 | pastel format hex

Each stage parses its input into an internal colour representation, applies one transformation, and prints a value the next stage can parse again. According to the README, input can arrive as positional arguments, as lines on standard input, or as a mix of both, with a dash marking the position where stdin values are substituted. The supported spaces listed in the README are RGB (sRGB), HSL, CIELAB, CIELCh, plus ANSI 8-bit and 24-bit representations. The Cargo.toml shows nom as a parsing dependency, which is consistent with the wide range of accepted input syntaxes the README demonstrates: colour names, bare hex, quoted hex, rgb() and hsl() function notation, and comma-separated triples.

Installing pastel and converting a colour

The README lists packages for Debian, Arch, Nix, macOS, Windows, snap and NetBSD, plus a cargo path for source builds. On a Debian-based system the README shows installing the release package with dpkg, and notes that pastel is also in the official Debian repositories (testing and unstable at the time of writing).

bash
sudo apt update
sudo apt install pastel

On macOS the README points at Homebrew, and on Windows at Scoop or Winget. If you prefer to build from source, the README states that Rust 1.83 or higher is required, which matches the rust-version = "1.83.0" field in Cargo.toml:

bash
cargo install pastel

Once installed, the first useful command is a format conversion. The README gives this example, which takes the hex value ff8000 and prints it as HSL:

bash
pastel format hsl ff8000

You should see the same colour expressed with hue, saturation and lightness components. From there, pastel color renders swatches in the terminal, and pastel distinct 8 generates a set of eight visually distinct colours, both shown in the README.

Where pastel stops being the right tool

pastel has no persistent palette file and no interactive editor. Every invocation is stateless, so a project-wide palette has to live in your own script, dotfile or config, and pastel is called to transform values on the way through. The README does not document rollback, undo or history for any subcommand, and it does not describe a way to name and save a palette. That is a deliberate boundary, but it means pastel will not replace a design tool for exploratory work. The pick subcommand depends on the platform's screen access, so it is the one part of the tool that may behave differently across operating systems; the README shows the command but does not enumerate platform support for it. Finally, if your colour decisions are made by designers in a graphical editor and exported as tokens, pastel is downstream of that process, not a substitute for it.

How pastel differs from ImageMagick and from browser devtools

ImageMagick can also convert colour values, and the difference in approach matters. ImageMagick is built around images: colours are usually properties of pixels, and the CLI is organised around image operations, so converting a single hex value means going through a tool whose centre of gravity is elsewhere. pastel is built around the value itself, with a subcommand per operation (mix, saturate, lighten, textcolor, paint) and no image model at all. Browser devtools sit at the other extreme: they give an interactive picker with immediate visual feedback, but the result has to be copied out manually and cannot be piped. pastel occupies the narrow space between them: non-interactive, pipe-friendly, and aware of CIELAB and CIELCh rather than only RGB and HSL. The README also links to background reading on colour difference and colour spaces, which signals that perceptual colour work is part of the intended scope.

Maintenance, licence and upgrade cost

The repository is not archived, and the last push was on 2026-05-01. Recent releases are v0.12.0 on 2026-02-14, v0.11.0 on 2025-10-19 and v0.10.0 on 2024-09-06, so the release cadence is roughly annual with a gap in between. That is slow but not dormant, and the CHANGELOG.md at the repository root is the place to check what changed between versions. Upgrading is low cost for a CLI of this kind: the surface is subcommands and flags, and the README's composition examples rely on stable input and output syntaxes. The one hard constraint is the Rust toolchain floor of 1.83.0 if you build from source, which is stated in both the README and Cargo.toml. On licensing, Cargo.toml declares MIT/Apache-2.0 and the README says the project is licensed under either Apache License, Version 2.0 or the MIT license, at your option. Both are permissive, but dual licensing means you choose one and should record which one your distribution relies on; this is a packaging decision, not legal advice.

Editorial conclusion

Adopt pastel if you convert or generate colours inside shell scripts, CI checks or terminal tooling and want one binary that speaks RGB, HSL, CIELAB, CIELCh and ANSI. Do not adopt it if you need a GUI colour picker with a persistent palette file, or if your workflow is entirely inside a design application. Before relying on it, verify that your target platform has a package in the release page or a distro repository, check the Rust version requirement (1.83.0) if you build from source, and confirm the licence terms you intend to use: the project is dual-licensed Apache-2.0 or MIT, at your option.

Frequently asked questions

How do I install pastel on Linux?

The README lists several routes: the Debian package from the release page installed with dpkg, the official Debian repositories via apt, the Arch Extra repository via pacman, Nix, snap, and NetBSD via pkgin. Building from source with cargo install pastel requires Rust 1.83 or higher.

How do I convert a colour to another format with pastel?

Use the format subcommand with the target format and the colour value, for example pastel format hsl ff8000. The README states that pastel supports RGB (sRGB), HSL, CIELAB, CIELCh and ANSI 8-bit and 24-bit representations.

Can pastel commands be chained together?

Yes. The README shows composition by piping, with the example pastel random | pastel mix red | pastel lighten 0.2 | pastel format hex. Colours can also be read from standard input, and a dash marks where stdin values are substituted among command-line arguments.

Does pastel store a colour palette between runs?

The README does not document any persistent palette file or saved state. Each invocation is a filter that reads colours and writes a colour, so any palette has to be kept in your own script or config.

What licence does pastel use?

The README states it is licensed under either the Apache License, Version 2.0 or the MIT license, at your option, and Cargo.toml declares MIT/Apache-2.0.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. Releases
  5. sharkdp/pastel on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/sharkdp-pastel.svg)](https://hysenlabs.com/projects/sharkdp-pastel)