So my idea would be to get rid of these .stage-* css classes and instead calculate the color in php and print it as an inline style. That way we are not limited to 8 stages.