Fix serialization of RGB types