mandelbrot/mandelbrot.c
void sample_pallete(int it, int n, unsigned char* result)
{
    int color_count = sizeof(pallete) / sizeof(pallete[0]) / 3;
 
    if (it < n && it > 0)
    {
        int index = it % color_count;

        for (int i = 0; i < 3; ++i)
            result[i] = pallete[index * 3 + i];
    }
    else
    {
        for (int i = 0; i < 3; ++i)
            result[i] = 0;
    }
}
/* populates result with a color from the pallete */
populates result with a color from the pallete
populates result with a color from the pallete
void sample_pallete(int it, int n, unsigned char* result)
{
    int color_count = sizeof(pallete) / sizeof(pallete[0]) / 3;
    if (it < n && it > 0)
    {
        int index = it % color_count;
        for (int i = 0; i < 3; ++i)
            result[i] = pallete[index * 3 + i];
    }
    else
    {
        for (int i = 0; i < 3; ++i)
            result[i] = 0;
    }
}
void sample_pallete ( int it , int n , unsigned char * result ) { int color_count = sizeof ( pallete ) / sizeof ( pallete [ 0 ] ) / 3 ; if ( it < n && it > 0 ) { int index = it % color_count ; for ( int i = 0 ; i < 3 ; ++ i ) result [ i ] = pallete [ index * 3 + i ] ; } else { for ( int i = 0 ; i < 3 ; ++ i ) result [ i ] = 0 ; } }
populates result with a color from the pallete
populates result with a color from the pallete