Color encoding function for RGBE