helper function to convert hex to uicolor