Fix upgrade path for custom colors

This commit is contained in:
Thomas Ricouard 2023-01-28 19:49:08 +01:00
parent 3d0b913a34
commit 6c22fc9383

View file

@ -24,7 +24,7 @@ extension Color: RawRepresentable {
let green = Double((rawValue & 0x00FF00) >> 8) / 0xFF
let blue = Double(rawValue & 0x0000FF) / 0xFF
let opacity = Double((rawValue & 0xFF000000) >> 24) / 0xFF
self = Color(red: red, green: green, blue: blue, opacity: opacity)
self = Color(red: red, green: green, blue: blue, opacity: opacity == 0 ? 1 : 0)
}
public var rawValue: Int {