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 9cd4256 commit f0107f9Copy full SHA for f0107f9
Sources/SwiftCrossUI/Color.swift
@@ -22,12 +22,22 @@ public struct Color {
22
self.alpha = alpha
23
}
24
25
+ /// Multiplies the opacity of the color by the given amount.
26
+ public consuming func opacity(
27
+ _ opacity: Float
28
+ ) -> Color {
29
+ self.alpha *= opacity
30
+ return self
31
+ }
32
+
33
/// Pure black.
34
public static let black = Color(0.00, 0.00, 0.00)
35
/// Pure blue.
36
public static let blue = Color(0.00, 0.48, 1.00)
37
/// Pure brown.
38
public static let brown = Color(0.64, 0.52, 0.37)
39
+ /// Completely clear.
40
+ public static let clear = Color(0.50, 0.50, 0.50, 0.00)
41
/// Pure cyan.
42
public static let cyan = Color(0.33, 0.75, 0.94)
43
/// Pure gray.
0 commit comments