Closed owenzhao closed 1 year ago
I don't think there's much we can do about this other than documenting the behavior. Color
is not directly serializable, so the serialization works by first converting to UIColor
/NSColor
and then using the native color serialization.
As a workaround, you could store UIColor.tintColor
and then just wrap it in Color()
where you use it.
static let traceColor = Defaults.Key<Color>("traceColor", default: Color(uiColor: .tintColor))
Suggested worked. Thank you and please add this to the document as a workaround.
I set accent color to system orange in assets folder. And in code
when reset the default key,
The accentColor set by reset is the system default blue instead my own setting orange. Any idea?
Defaults 7.2.0 Xcode 14.3.1 (14E300b) iOS 16.5