Skip to content

Instantly share code, notes, and snippets.

@yvan
Created November 6, 2017 19:31
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/9f1854361d6e2b5948c053b355949113 to your computer and use it in GitHub Desktop.
Save yvan/9f1854361d6e2b5948c053b355949113 to your computer and use it in GitHub Desktop.
blue = [65,105,225]
green = [34,139,34]
beach = [238, 214, 175]
snow = [255, 250, 250]
mountain = [139, 137, 137]
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
elif world[i][j] < 0.35:
color_world[i][j] = mountain
elif world[i][j] < 1.0:
color_world[i][j] = snow
return color_world
color_world = add_color(world)
toimage(color_world).show()
@Ayush4cosmos
Copy link

it over rides the snow and mountain condition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment