title: How to save CGFloat and Color to realm DB?
body: <p>I want to use realm to save data but as far as I understand realm does not support <code>CGFloat</code> and <code>Color</code> property, I searched for solution but it seems there is no answer.</p>
  <p><a href="https://stackoverflow.com/questions/56392378/saving-properties-not-supported-by-realmswift">Saving properties not supported by RealmSwift</a></p>
  <p>In documentation said : <strong>“CGFloat properties are discouraged, as the type is not platform independent.”</strong></p>
  <p>In my app I use DragGesture and the value that returns for <code>width</code> and <code>height</code> are CGFloat this is my struct:</p>
  <pre><code>struct Card : Identifiable {
    
    var id = UUID()
    var name : String
    var color : Color
    var y : CGFloat = 0
    var x : CGFloat = 0
    
  }
  </code></pre>
  <p>and DB so far :</p>
  <pre><code>class cardDB : Object {
    
    @objc dynamic var id = UUID()
    @objc dynamic var name = &quot;&quot;
    
  }
  </code></pre>
  <p>Is there any way to save these two property to realm DB?</p>