sindresorhus/Defaults

Use `Color.Resolved` to serialize `Color` on macOS 14+

Open

#143 aperta il 16 giu 2023

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Swift (162 fork)user submission
enhancementhelp wanted

Metriche repository

Star
 (2465 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

https://developer.apple.com/documentation/swiftui/color/resolve(in:) https://developer.apple.com/documentation/swiftui/color/resolved

It should be able to store the color better than what we currently do. We still need to preserve backwards compatibility, so we can first try loading it as Color.Resolved and if it fails, we can use the old way.

Color.Resolved is Codable, so we should use that for the serialization.

Guida contributor