// color shades // #include #include #include "ppm.h" int main( void) { ppm a = ppm_new( 256, 256); // double s2 = sqrt(2); for( int i = 0; i < 256; ++i) for( int j = 0; j < 256; ++j) { a.r[i][j] = i; // a.g[i][j] = 255 - hypot(i,j)/s2; int g = 255 - hypot(i,j); a.g[i][j] = (g >= 0) ? g : 0; a.b[i][j] = j; } ppm_write(a); return 0; }