Revised color function.