ClassbreaksRenderer should work! Please feel free to share your code with me.
You can also use RasterStretchRenderer for your cog. The following an example that works your cog. Please refer to this doc to learn more about stretching: https://pro.arcgis.com/en/pro-app/latest/help/data/imagery/histogram-stretching.htm
const layer = new ImageryTileLayer({
renderer: new RasterStretchRenderer({
stretchType: "min-max",
statistics: [[-227, 50, -172, 19]],
useGamma: false,
computeGamma: false,
dra: false,
gamma: [1],
colorRamp: {
type: "multipart",
colorRamps: [
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [255, 45, 8, 255],
toColor: [255, 57, 251, 255]
}),
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [255, 57, 251,255],
toColor: [26,35,253,255]
}),
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [ 26, 35, 253, 255],
toColor: [ 0, 181, 255, 255 ]
}),
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [ 0, 181, 255, 255 ],
toColor: [ 0, 253, 255, 255 ]
}),
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [ 0, 253, 255, 255 ],
toColor: [ 0, 251, 50, 255 ]
}),
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [ 0, 251, 50, 255 ],
toColor: [ 255, 254, 52, 255 ]
}),
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [ 255, 254, 52, 255 ],
toColor: [ 255, 181, 61, 255 ]
}),
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [ 255, 181, 61, 255 ],
toColor: [ 255, 45, 8, 255 ]
}),
new AlgorithmicColorRamp({
algorithm: "hsv",
fromColor: [ 255, 45, 8, 255 ],
toColor: [ 190, 190, 190, 255 ]
})
]
}
}),
url: "data/cog/raster.tif",
});