mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
14 lines
355 B
Python
14 lines
355 B
Python
#!/usr/bin/env python
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
colormaps = ('viridis', 'inferno', 'magma', 'jet', 'binary')
|
|
for c in colormaps:
|
|
cmap_name = c
|
|
cmap = plt.get_cmap(cmap_name)
|
|
|
|
colors = [[int(round(255 * x)) for x in cmap(i)[:3]] for i in range(256)]
|
|
print(f'var {c} = {colors}')
|
|
|
|
print(f'var colormaps = [{", ".join(colormaps)}];')
|