From reading the article it seems to me that it's not you, but your sensors that post the colour. So you specify the min/max range of your sensor values, a colour which is mapped to middle of that range and then the colour changes depending on the sensors current value.