Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mikequentel
Created December 5, 2014 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikequentel/e32acc62b3ae5e330558 to your computer and use it in GitHub Desktop.
Save mikequentel/e32acc62b3ae5e330558 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
FILE *fp;
fp = fopen("true_colour.txt", "w");
int r = 255;
int g = 255;
int b = 255;
for (r = 255; r >= 0; r--) {
for (g = 255; g >= 0; g--) {
for (b = 255; b >= 0; b--) {
fprintf(fp, "%d", r);
fprintf(fp, ",");
fprintf(fp, "%d", g);
fprintf(fp, ",");
fprintf(fp, "%d", b);
fprintf(fp, "\n");
}
}
}
fclose(fp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment