Install pastel on Raspberry Pi

Install pastel on Raspberry Pi

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

This tutorial shows how to install pastel on Raspberry Pi.

Install pastel

Connect to Raspberry Pi via SSH. Get the latest version tag of pastel release from GitHub and assign it to variable.

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

Execute the following command to 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}-arm-unknown-linux-gnueabihf.tar.gz"

Next, 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 as system-wide command.

We can check pastel version:

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, if we want to show information about a given color, we can specify color argument.

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 Raspberry Pi

We can convert color to given format using format argument. For example, the following example converts HEX to RGB color:

pastel -f format rgb 2da44e
Convert HEX to RGB color using pastel on Raspberry Pi

Uninstall pastel

If you want to remove pastel, delete executable file:

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

Leave a Comment

Cancel reply

Your email address will not be published.