Add generic function to convert colors