Which of the 2 circles in the image below is darker, and which one is lighter?
Our perception of the intensity of a colour is not only determined by the colour itself, but also by the contrast of the colour with its surroundings. So when you use colour to encode numerical values, you need to make sure that the background has the same colour, or at least does not have wildly varying colours and colour intensities.