Improvement to color functions