Install pastel on Ubuntu 20.04

The pastel is a tool for converting, generating, analyzing and manipulating colors via command line. This tool is written in Rust programming language.

This tutorial explains how to install pastel on Ubuntu 20.04.

Install pastel

Retrieve the latest version tag of pastel release from GitHub. Assign version tag to variable.

PASTEL_VERSION=$(curl -s "https://api.github.com/repos/sharkdp/pastel/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Next, download tar.gz file from releases page of the pastel repository.

curl -Lo pastel.tar.gz "https://github.com/sharkdp/pastel/releases/latest/download/pastel-v${PASTEL_VERSION}-x86_64-unknown-linux-gnu.tar.gz"

Create temporary directory and extract a tar.gz file:

mkdir pastel-temp
tar xf pastel.tar.gz --strip-components=1 -C pastel-temp

Move executable file to /usr/local/bin directory.

sudo mv pastel-temp/pastel /usr/local/bin

Now pastel command will be available for all users.

We can check pastel version as follows:

pastel --version

Remove tar.gz file and temporary directory:

rm -rf pastel.tar.gz
rm -rf pastel-temp

Testing pastel

The pastel command supports various subcommands. For example, we can specify color argument to show information about a given color.

pastel -f color 2da44e

Note: the -f option forces to use 24-bit color mode for output if available.

Display color information using pastel on Ubuntu

The format argument allows to convert color to a given format. For example, the following example converts HEX to RGB color:

pastel -f format rgb 2da44e
Convert HEX to RGB Color using pastel on Ubuntu

Uninstall pastel

If you decided to completely remove pastel, just delete related file:

sudo rm -rf /usr/local/bin/pastel

Leave a Comment

Your email address will not be published. Required fields are marked *