Last active
December 26, 2021 17:44
-
-
Save micalevisk/a1eeb59dff4b3490a3dff37649170c6f to your computer and use it in GitHub Desktop.
Minimal bash script to convert RGB to 256 terminal color wisely.
This file contains hidden or 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
#!/bin/bash | |
## convert RGB to 256 terminal color | |
rgb="${1//[!0-9,]/}" # 0..255,0..255,0..255 | |
echo -n "\e[0;38;2;${rgb//,/;}m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
testing