For my implementation it's easiest to describe single colors as a 1-valued colormap. Currently this is not possible in cmap as the colormap by default adds a black transparent 0-value:
>>> import cmap
>>> cmap.Colormap([[0.5,1.,1.,1.]]).as_dict()
{'name': 'custom colormap', 'identifier': 'custom_colormap', 'category': None, 'value': [(0.0, [0, 0, 0, 0]), (1.0, [0.5, 1.0, 1.0, 1.0])]}
>>> cmap.Colormap(['violet']).as_dict()
{'name': 'custom colormap', 'identifier': 'custom_colormap', 'category': None, 'value': [(0.0, [0, 0, 0, 0]), (1.0, [0.9333333333333333, 0.5098039215686274, 0.9333333333333333, 1])]}
Is this a feature (and if so should i be switching to Color for these cases), or is this unintended?
Hi,
For my implementation it's easiest to describe single colors as a 1-valued colormap. Currently this is not possible in cmap as the colormap by default adds a black transparent 0-value:
Is this a feature (and if so should i be switching to Color for these cases), or is this unintended?
Thanks!