sharkdp / pastel

A command-line tool to generate, analyze, convert and manipulate colors
Apache License 2.0
4.98k stars 97 forks source link

Support "short" display option? #139

Closed kiedtl closed 2 years ago

kiedtl commented 3 years ago

A display mode as seen in the following images would be useful, as it makes it easier to visually compare colors.

and

Would a PR implementing this be merged?

sharkdp commented 3 years ago

Thank you for your request. Please see #137 and #21.

sharkdp commented 3 years ago

Also, note that pastel enables you to write scripts like this:

#!/bin/bash

cols=$(tput cols)
spaces=$(printf %"$((cols - 7))"s | tr " " " ")

for color in "$@"; do
    hex_code="$(pastel format hex "$color")"
    textcolor="$(pastel textcolor "$color")"
    pastel paint "$textcolor" --on "$color" "$hex_code$spaces"
done

which can be called like:

bash compare_colors.sh steelblue lime firebrick