def mandelbrot_calc_row(y, w, h, image_rows, max_iteration=1000):
    """ Calculate one row of the mandelbrot set with size wxh """
    y0 = y * (2 / float(h)) - 1
    for x in range(w):
        x0 = x * (3.5 / float(w)) - 2.5
        i, z = 0, 0 + 0.0j
        c = complex(x0, y0)
        while abs(z) < 2 and i < max_iteration:
            z = z ** 2 + c
            i += 1
        color = i % 8 * 32, i % 16 * 16, i % 32 * 8
        image_rows[y * w + x] = color
