from kandinsky import* def Julia(N_iteration): palette = [] xmax = 2 xmin = -2 ymax = 1.3875 ymin = -1.387 r = 255 g = 255 b = 255 for j in range(0,128): b = 255 -2 * j palette.append([r,g,b]) for j in range(128,256): r = 255 -2 * (j-128) g = 255 -2 * (j-128) palette.append([r,g,b]) for x in range(320): for y in range(222): i = 0 z = complex(xmin+(xmax-xmin)*x/320+(ymax-(ymax-ymin)*y/222)*1J) c = complex(0.36,0.36) while i < N_iteration and abs(z) < 2: i = i + 1 z = z*z+c couleur = palette[int(255*i/N_iteration)] col = color(couleur[0],couleur[1],couleur[2]) set_pixel(x,y,col)