Hello,
I have setup the following renderer for my raster layer. It works very well:
let rendererRaster = new RasterStretchRenderer({
statistics: [[0, 100, 0, 0]],
stretchType: "min-max",
colorRamp: new MultipartColorRamp({
colorRamps: [
{ algorithm: "cie-lab", fromColor: new Color([255, 255, 217, 255]), toColor: new Color([199, 233, 180, 255]) },
{ algorithm: "cie-lab", fromColor: new Color([199, 233, 180, 255]), toColor: new Color([127, 205, 187, 255]) },
{ algorithm: "cie-lab", fromColor: new Color([127, 205, 187, 255]), toColor: new Color([65, 182, 196, 255]) },
{ algorithm: "cie-lab", fromColor: new Color([65, 182, 196, 255]), toColor: new Color([29, 145, 192, 255]) },
{ algorithm: "cie-lab", fromColor: new Color([29, 145, 192, 255]), toColor: new Color([34, 94, 168, 255]) },
{ algorithm: "cie-lab", fromColor: new Color([34, 94, 168, 255]), toColor: new Color([37, 52, 148, 255]) },
{ algorithm: "cie-lab", fromColor: new Color([37, 52, 148, 255]), toColor: new Color([8, 29, 88, 2555]) },
]
})
});
But now I would like to use the preset colorramps that you show here: https://developers.arcgis.com/javascript/latest/visualization/symbols-color-ramps/esri-color-ramps/#ramps
So I try doing the following, but It doesn't work (the raster is shown as black and white):
let rendererRaster = new RasterStretchRenderer({
statistics: [[0, 100, 0, 0]],
stretchType: "min-max",
colorRamp: colorRamps.byName("Blue 6")
});
How can I use the preset coloramps?