Fix `final func toRGBAComponents()` on macOS for non-RGB colors
This commit is contained in:
parent
1e85f9461f
commit
04f7891d8c
|
@ -62,14 +62,11 @@ public extension DynamicColor {
|
||||||
|
|
||||||
return (r, g, b, a)
|
return (r, g, b, a)
|
||||||
#elseif os(OSX)
|
#elseif os(OSX)
|
||||||
if isEqual(DynamicColor.black) {
|
guard let rgbaColor = self.usingColorSpace(.deviceRGB) else {
|
||||||
return (0, 0, 0, 0)
|
fatalError("Could not convert color to RGBA.")
|
||||||
}
|
|
||||||
else if isEqual(DynamicColor.white) {
|
|
||||||
return (1, 1, 1, 1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getRed(&r, green: &g, blue: &b, alpha: &a)
|
rgbaColor.getRed(&r, green: &g, blue: &b, alpha: &a)
|
||||||
|
|
||||||
return (r, g, b, a)
|
return (r, g, b, a)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue