Try something like: I have not tested it in any way, just quickly written it down, so I may have missed something or it may not be correct syntax (I may or may not have even added errors on purpose to help you learn – just kidding). More or less interesting points are:there is a new property with an integer type, this should fix the negative comparisons You had a gap (no colours between -1 and 4) between where you switched to "<=" – it's easier to just stick with ">=" and make an else for everything that does not match. Keep in mind: Long lists of if/else almost always are a sign that something could be better thought out.