Skip to content

Instantly share code, notes, and snippets.

@yvan
Created November 6, 2017 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yvan/c73ce9a819f68040928462824bc4531f to your computer and use it in GitHub Desktop.
Save yvan/c73ce9a819f68040928462824bc4531f to your computer and use it in GitHub Desktop.
blue = [65,105,225]
green = [34,139,34]
beach = [238, 214, 175]
def add_color(world):
color_world = np.zeros(world.shape+(3,))
for i in range(shape[0]):
for j in range(shape[1]):
if world[i][j] < -0.05:
color_world[i][j] = blue
elif world[i][j] < 0:
color_world[i][j] = beach
elif world[i][j] < 1.0:
color_world[i][j] = green
return color_world
color_world = add_color(world)
toimage(color_world).show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment