Initial zoom in on diamond fractal

This commit is contained in:
Grant Sanderson
2017-01-16 13:26:46 -08:00
parent 209264e90c
commit 0835d52bb4
5 changed files with 114 additions and 53 deletions

View File

@ -116,6 +116,8 @@ def color_to_int_rgb(color):
return (255*color_to_rgb(color)).astype('uint8')
def color_gradient(reference_colors, length_of_output):
if length_of_output == 0:
return reference_colors[0]
rgbs = map(color_to_rgb, reference_colors)
alphas = np.linspace(0, (len(rgbs) - 1), length_of_output)
floors = alphas.astype('int')