Highly optimized the mixColors util function.