Try something like: <snip>
convert temperatureHighLabel.text to a number and work with that.
Rectangle { id: colorTemperature width: 100; height: 140 radius: 12 property int tempMin: -20 property int tempMax: 40 property int temperatureInt: { return max(tempMin, min(tempMax, parseInt(temperatureHighLabel.text))); } property real scale: 0.9 anchors.centerIn: temperatureHighLabel color: Qt.hsla((scale * (tempMax - temperatureInt)) / (tempMax - tempMin), 1, // full saturation, feel free to experiment 1, // full lightness, feel free to experiment 1); // no transparency, feel free to experiment }