DEVELOPMENT ENVIRONMENT

~alex/mandelbrot-set-gen

ref: 91e1dfa064864f71f2df4c86dba62dd44865260b mandelbrot-set-gen/src/color.c -rw-r--r-- 301 bytes
91e1dfa0Alejandro Laguna fix: only calculate points if position has been updated a month ago
                                                                                
1
2
3
4
5
6
7
8
9
void get_color(int iter, int max_iter, int* r, int* g, int* b) {
    if (iter == max_iter) {
        *r = *g = *b = 0; // black inside the set
        return;
    }
    double t = (double)iter / max_iter;
    int gray = (int)((1.0 - t) * 255); // whiter the furthest it was
    *r = *g = *b = gray;
}