Last active
April 19, 2026 18:30
-
-
Save rasmusmerzin/01d6823911e9e2774d9c1a17be18da0e to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| # Usage: rgb [Red 0-5] [Green 0-5] [Blue 0-5] | |
| c=$((16+(${1:-0}*36)+(${2:-0}*6)+(${3:-0}*1))) | |
| if [[ -t 1 ]] | |
| then printf '\e[38:5:%dm%-3d\e[m\n' $c $c | |
| else echo $c | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment