A search on this forum, for discrete colorscale
displays a lot of examples I posted during the last years.
Here
https://community.plotly.com/t/what-is-wrong-with-this-example/30771/4
or here:
https://chart-studio.plotly.com/~empet/15229/heatmap-with-a-discrete-colorscale/#/
it is explained how you can define a discrete colorscale. In your case the normalization function is:
f: [1, 25]->[0,1]
f(t) = (t-1)/24
Hence:
f(1) = 0
f(4) = 1/8
f(8) = 7/24
f(12) = 11/24
f(20) = 19/24
f(25) = 1
Your intervals are not adjacent, but I think that 7, 11, 17, 18, 19 cannot be met among your data. If this is the case then
the corresponding colorscale is defined as follows:
dcolorscale= [[0, '#92D050'],
[1/8, '#92D050'],
[1/8, '#00B005'],
[7/24, '#00B005'],
[7/24, '#FFCC00'],
[11/24, '#FFCC00'],
[11/24, '#FF3300'],
[19/24, '#FF3300'],
[19/24, '#CC0000'],
[1, '#CC0000']]