Open sebbelese opened 3 years ago
Same here!
Wanted to set legend json to continuous colormap like in example on https://django-raster.readthedocs.io/en/latest/tms.html#continuous-color-schemes - but as @sebbelese pointed out, implementation of colormap function in legend only supports discrete color maps.
It would be nice, if legend.colormap
would make use of colormap_to_rgba
!
For now, I will implement your solution @sebbelese - thanks!
Hi,
I have an issue with the use of programmatically created legends, but I am not sure if this is a bug or a misuse of my part.
First, I create programmatically a grayscale legend:
But when I try to render tiles, it complains that the colors cannot be converted from hex to rgb. This is due to the
colormap
function inmodels.py
where it tries to convert the color associated with thecontinuous
expression to a rgb color:My workaround was to update the
colormap
function, but I am not sure if this was the actual issue, or if my legend was not correctly created.