Created
June 22, 2018 22:45
-
-
Save jhallard/d77fca8164d2a24d5b4f66bd120cf525 to your computer and use it in GitHub Desktop.
Show an R,G,B color from the terminal using python and PIL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
showcolor () { | |
if [ "$#" -lt 3 ]; then | |
echo "need to give 3 (r,g,b) values" | |
return 1 | |
fi | |
python -c "from PIL import Image; Image.new('RGB', (300, 300), ($1, $2, $3)).show()" | |
} | |
# use like | |
# $ showcolor 125 125 200 | |
# to open a 300x300 window with the color RGB(125, 125, 200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment