Replace the color-parsing function with a better one