It now checks if the color is valid