colour func infinite recursion fix