We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e2e875 commit 271bcddCopy full SHA for 271bcdd
Sources/YCoreUI/Extensions/UIKit/UIColor+rgbValue.swift
@@ -34,15 +34,17 @@ public extension UIColor {
34
let g = Int(round(comp.green * 255))
35
let b = Int(round(comp.blue * 255))
36
let isRGB = (r >= 0 && r <= 255) && (g >= 0 && g <= 255) && (b >= 0 && b <= 255)
37
+ let prefix = prefix ?? ""
38
let value = String(
39
format: format,
40
min(max(r, 0), 255),
41
min(max(g, 0), 255),
42
min(max(b, 0), 255)
43
)
44
+ let suffix = (isDebug && !isRGB) ? "⚠️" : ""
45
if !isRGB && YCoreUI.isLoggingEnabled {
46
YCoreUI.colorLogger.warning("Color \(self) falls outside of the sRGB color space.")
47
}
- return "\(prefix ?? "")\(value)\(isDebug && !isRGB ? "⚠️" : "")"
48
+ return "\(prefix)\(value)\(suffix)"
49
50
0 commit comments