Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
cat > /tmp/termcolors.java <<EOF
public class termcolors {
public static void main(String[] args) {
for (int i = 0; i < 256; i++) {
System.out.printf("\033[38;5;%sm#@%03d", i, i);
System.out.print(" ");
if (i % 12 == 0) System.out.println();
}
System.out.println();
}
}
EOF
javac /tmp/termcolors.java &&
java -cp /tmp termcolors
cat <<EOF
#!/bin/bash
N=202
echo -e "\033[38;5;\${N}mTry Me\033[0m"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment