EXTENSION
public extension Color
var inverted: Color
Inverse color
static func hex(_ hex: UInt, alpha: Double = 1) -> Self
Initialize with HEX
- Parameter hex: HEX UInt value
- Returns: Color
Name | Description |
---|---|
hex | HEX UInt value |
static func hex(_ hex: String, alpha: CGFloat = 1) -> Self
Initialize with HEX
- Parameter hex: HEX String value
- Returns: Color
Name | Description |
---|---|
hex | HEX String value |
init(hex: String)
Initialize with HEX
- Parameter hex: HEX
Name | Description |
---|---|
hex | HEX |
static func random(opacity: CGFloat = 1.0) -> Color
Generate a random color
- Parameter opacity: opacity
- Returns: New color
Name | Description |
---|---|
opacity | opacity |
func lighten(by percentage: CGFloat = 30.0) -> Color
Lighten color
- Parameter percentage: percentage (1 -100), default: 30
- Returns: new color
Name | Description |
---|---|
percentage | percentage (1 -100), default: 30 |
func darken(by percentage: CGFloat = 30.0) -> Color
Darken color
- Parameter percentage: percentage (1 -100), default: 30
- Returns: new color
Name | Description |
---|---|
percentage | percentage (1 -100), default: 30 |
static func dynamicColor(light: UIColor, dark: UIColor) -> Color
Create a color with a dark and light mode UIColor
- Parameters:
- light: light color
- dark: dark color
- Returns: Color
Name | Description |
---|---|
light | light color |
dark | dark color |