Skip to content

Instantly share code, notes, and snippets.

@JamesSaxon
Created August 20, 2019 19:00
Show Gist options
  • Select an option

  • Save JamesSaxon/f0641c772705be542845c0080abf788e to your computer and use it in GitHub Desktop.

Select an option

Save JamesSaxon/f0641c772705be542845c0080abf788e to your computer and use it in GitHub Desktop.
Hex Colors from MPL Colormap
import matplotlib.pyplot as plt
N = 12
["#{0:02X}{1:02X}{2:02X}".format(*[int(v*255) for v in plt.get_cmap("viridis")(n/(N-1))][:3]) for n in range(N)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment