I'm trying to create a color table for Terracotta as described here: https://terracotta-python.readthedocs.io/en/latest/tutorials/custom-colormaps.html.
My goal is to create a colormap that is similar to the following color ramp:
The colors are provided via hex codes:
I'm hoping that someone can advise the best way to convert this into a colormap that is compatible with Terracotta. At this point, I'm unsure the best way to create the map with stop colors and the only example that the Terracotta team has provided was to create a grayscale color map.
>>> import numpy as np
>>> cmap_data = np.stack((
... np.arange(0, 255, dtype='uint8'),
... np.arange(0, 255, dtype='uint8'),
... np.arange(0, 255, dtype='uint8'),
... np.full(255, 255, dtype='uint8')
... ), axis=1)
>>> np.save('mycmap_rgba.npy', cmap_data)