Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#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