Skip to content

Commit cefa0dd

Browse files
committed
propagated the N parameter for choosing number of levels into more functions
1 parent 818852c commit cefa0dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmocean/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import matplotlib as mpl
77

88

9-
def print_colormaps(cmaps, returnrgb=True, savefiles=False):
9+
def print_colormaps(cmaps, N=256, returnrgb=True, savefiles=False):
1010
'''Print colormaps in 256 RGB colors to text files.
1111
1212
:param returnrgb=False: Whether or not to return the rgb array. Only makes sense to do if print one colormaps' rgb.
@@ -17,7 +17,7 @@ def print_colormaps(cmaps, returnrgb=True, savefiles=False):
1717

1818
for cmap in cmaps:
1919

20-
rgbtemp = cmap(np.linspace(0, 1, 256))[np.newaxis, :, :3][0]
20+
rgbtemp = cmap(np.linspace(0, 1, N))[np.newaxis, :, :3][0]
2121
if savefiles:
2222
np.savetxt(cmap.name + '-rgb.txt', rgbtemp)
2323
rgb.append(rgbtemp)

0 commit comments

Comments
 (0)