How to colour a heatmap so that values are given a specific colour mapping independent of range

I am making a heatmap plot using px.imshow that describes an 8x8 array of statuses. I want a specific status eg status 5 to be green, 255 to be red, 6 to be blue etc. I don’t want the colours to be on a scale, I want a discrete colour mapping, independent of the range of the data.
The data will be changing and usually won’t contain all of the statuses at once

How can I do that? I have seen workarounds trying to normalise the colours depending on the range of the data but that seems super convoluted

@eee Here b'Heatmap with a discrete colorscale | empet | Plotly' is explained how to perform such a colormapping.