Fix TypeError in color_to_hash() (LP: #1166884)