Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Sources/SwiftCrossUI/Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ public struct Color {
self.alpha = alpha
}

/// Multiplies the opacity of the color by the given amount.
public consuming func opacity(
_ opacity: Float
) -> Color {
self.alpha *= opacity
return self
}

/// Pure black.
public static let black = Color(0.00, 0.00, 0.00)
/// Pure blue.
public static let blue = Color(0.00, 0.48, 1.00)
/// Pure brown.
public static let brown = Color(0.64, 0.52, 0.37)
/// Completely clear.
public static let clear = Color(0.50, 0.50, 0.50, 0.00)
/// Pure cyan.
public static let cyan = Color(0.33, 0.75, 0.94)
/// Pure gray.
Expand Down
Loading