Skip to content

Instantly share code, notes, and snippets.

@tene
Created March 28, 2010 04:19
Show Gist options
  • Save tene/346564 to your computer and use it in GitHub Desktop.
Save tene/346564 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int rgb(int r, int g, int b) {
return 16 + r*36 + g*6 + b;
}
void main() {
for (int r = 0; r < 6; r++) {
for (int g = 0; g < 6; g++) {
for (int b = 0; b < 6; b++) {
for (int bgr = 0; bgr < 6; bgr++) {
for (int bgg = 0; bgg < 6; bgg++) {
for (int bgb = 0; bgb < 6; bgb++) {
printf("\e[38;5;%dm\e[48;5;%dm#\e[0m", rgb(r,g,b), rgb(bgr,bgg,bgb));
}
}
printf("\n");
}
}
}
printf("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment