How to Install and Use pastel in Linux to Generate, Convert, and Pick Colours in the Terminal

Web developers, terminal customisers, and graphic designers frequently work with hexadecimal colour codes, RGB values, and HSL vectors. Switching between terminal sessions and web-based colour pickers disrupts workflow focus. pastel is a high-performance command-line utility written in Rust that brings comprehensive colour generation, format conversion, contrast checking, and palette manipulation directly into the Linux terminal.

Installing pastel on Linux Distributions

pastel can be installed across common Linux environments through native packages or cargo:

  • Ubuntu and Debian: Download the latest .deb binary from GitHub releases or install via apt where packaged:
    sudo apt install pastel
  • Arch Linux: Install directly from the official community repository:
    sudo pacman -S pastel
  • Cargo (Any Distribution): If you have Rust installed:
    cargo install pastel

Converting and Inspecting Colours

pastel accepts colours in virtually any format (Hex, RGB, HSL, LAB, or CSS colour names) and prints an interactive visual swatch directly inside true-colour terminal emulators:

  1. Inspecting a Colour: To inspect details, complementary tones, and luminance for a hex code:
    pastel color "#3b82f6"
  2. Converting Between Colour Spaces: Convert a hexadecimal string to HSL or RGB instantly:
    pastel format hsl "#10b981"
    pastel format rgb "#f43f5e"
  3. Generating Random Harmonious Palettes: Generate four visually distinct random colours:
    pastel random -n 4

Measuring Contrast and Accessibility

Ensuring readable contrast ratios between text and background colours is essential for WCAG compliance. pastel includes dedicated accessibility commands:

  • Checking Contrast Ratios: Evaluate contrast between text and background:
    pastel textcolor "#1e293b"
    This command recommends whether black or white text provides optimal legibility against the provided background tone.
  • Interpolating Colour Gradients: Generate a smooth 5-step colour ramp between two hex codes:
    pastel gradient "#3b82f6" "#ec4899" -n 5

Integrating pastel into your Linux developer workflow simplifies theme creation, CSS styling, and design system audits without leaving your shell.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.