Fix: background color transparency isn't saving (#468) close #441

This commit is contained in:
David Walter 2023-01-28 18:41:27 +01:00 committed by GitHub
parent 11d4a84bd8
commit 3ce5b95171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -23,7 +23,8 @@ extension Color: RawRepresentable {
let red = Double((rawValue & 0xFF0000) >> 16) / 0xFF
let green = Double((rawValue & 0x00FF00) >> 8) / 0xFF
let blue = Double(rawValue & 0x0000FF) / 0xFF
self = Color(red: red, green: green, blue: blue)
let opacity = Double((rawValue & 0xFF000000) >> 24) / 0xFF
self = Color(red: red, green: green, blue: blue, opacity: opacity)
}
public var rawValue: Int {
@ -33,7 +34,8 @@ extension Color: RawRepresentable {
let red = Int(coreImageColor.red * 255 + 0.5)
let green = Int(coreImageColor.green * 255 + 0.5)
let blue = Int(coreImageColor.blue * 255 + 0.5)
return (red << 16) | (green << 8) | blue
let alpha = Int(coreImageColor.alpha * 255 + 0.5)
return (alpha << 24) | (red << 16) | (green << 8) | blue
}
private var coreImageColor: CIColor? {