Type Projections CustomPersistable UIColor

I have seen where CGFloat, CGPoint and SwiftUI Color are extended for Realm using CustomPersistable
I have been trying to do the same for UIColor but am failing miserably.
Does anyone have the code that would help me with this? I feel I am missing something basic.
I am hoping that one more example might open up my mind a bit.