Pastel Is A New Tool To Work With Colors From The Terminal

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

Pastel is a new free and open source command line tool to work with colors / perform various color operations. It's written in Rust, and it can convert colors from one format to another, show and analyze colors on the terminal, generate a set of visually distinct colors, and there's even a color picker, along with much more.

The tool has support for many different color formats and color spaces, including RGB, HSL, CIELAB, CIELCh as well as ANSI 8-bit and 24-bit representations.

Available Pastel subcommands:

  • color: Display information about the given color
  • list: Show a list of available color names
  • random: Generate a list of random colors
  • distinct: Generate a set of visually distinct colors by maximizing the perceived color difference between pairs of colors
  • sort-by: Sort a list of colors by the given property
  • pick: Interactively pick a color from the screen (pipette)
  • format: Convert the given color(s) to a specific format
  • paint: Print colored text using ANSI escape sequences
  • gradient: Generate a sequence of colors that interpolates between 'start' and 'stop'. The interpolation is performed in the specified color space
  • mix: Create new colors by interpolating between two colors in the given colorspace
  • saturate: Increase color saturation by a specified amount
  • desaturate: Decrease color saturation by a specified amount
  • lighten: Lighten color by a specified amount
  • darken: Darken color by a specified amount
  • rotate: Rotate the hue channel by the specified angle
  • complement: Get the complementary color (hue rotated by 180°)
  • gray: Create a gray tone from a given lightness
  • to-gray: Completely desaturate a color (preserving luminance)
  • textcolor: Return a readable foreground text color (either black or white) for a given background color. This can also be used in the opposite way, i.e. to create a background color for a given text color.

It's worth noting that for the color picker command to work (pastel pick), you'll need to have an external color picker installed, users being able to choose from gpick, xcolor, grabc, colorpicker and chameleon.

You may also like: 179 Color Schemes For Your Gtk-Based Linux Terminal (Gnome Terminal, Tilix, Xfce Terminal, More)

A few Pastel examples, with screenshots:

Post a Comment

Mới hơn Cũ hơn