<div dir="ltr"><div><br clear="all"></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style=""><font color="#000000" face="arial, helvetica, sans-serif">Hi all,</font></div><div style=""><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div style=""><font color="#000000" face="arial, helvetica, sans-serif">Using the python API I'm trying to set a colorrange which includes a gradient to alpha (so that the bottom end of the colorscale is transparent). I've seen examples which suggest this should work from the mapfile eg. </font><a href="https://github.com/MapServer/MapServer/blob/main/msautotest/gdal/heat.map">https://github.com/MapServer/MapServer/blob/main/msautotest/gdal/heat.map</a>.</div><div style=""><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div style=""><font color="#000000" face="arial, helvetica, sans-serif">I'm trying to do it using the python API, I've tried setting the max and the min like this:<br><br></font>    color_style.maxcolor = ms.colorObj("#00ffff00")<br>    color_style.mincolor = ms.colorObj("#000000ff")<font color="#000000" face="arial, helvetica, sans-serif"></font></div><div style=""><br></div><div style="">but the alpha value disappears when I check the color style, and also defining manually like `COLORRANGE  "#00ffff00"  "#000000ff"` and then using updateFromString().</div><div style=""><br></div><div style="">When I check the string everything looks correct:<br><br><div style="color:rgb(59,59,59);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;line-height:19px;white-space:pre"><div>STYLE<br>  COLORRANGE  "#00ffff00"  "#000000ff"<br>  DATARANGE 0.100000 1.000000<br>END # STYLE</div><br></div>but after I've run update from string, it seems to reinterpret as RGB without the alpha value:</div><div style=""><br></div><div style="">CLASS<br>  NAME "Yellow-brown shade gradient"<br>  GROUP "Yellow-brown_shade_gradient"<br>  STYLE<br>    COLORRANGE 0 255 255  0 0 0<br>    DATARANGE 0.100000 1.000000<br>  END # STYLE<br>END # CLASS<br><br>And then I don't get any transparency in the resulting layer. Am I doing something wrong, or is there any way around this using the API?</div><div style=""><br></div><div style="">Thanks,</div><div style="">Alistair</div><div style=""><br></div></div></div></div></div></div></div></div></div></div></div></div>