Color
Mechanica
Alias for NSColor.
-
Mechanica
Returns the hexadecimal string representation of
self
in the sRGB space. -
Mechanica
Initializes and returns a random color object in the sRGB space.
-
Mechanica
Returns the color’s RGBA components as Ints.
-
Mechanica
Returns the color’s RGBA components as a tuple of
CGFloat
. -
Mechanica
Creates a
new
color in the sRGB color space (if needed) guard letthat matches (or closely approximates) the current color. Although the new color might have different component values, it looks the same as the original.Note
WWDC 2016 - 712
-
Mechanica
Returns a sRGB color from a hexadecimal integer.
Example:
Color(hex: 0xFF0000) Color(hex: 0xFF0000, alpha: 0.5)
-
Mechanica
Creates and returns an Color object given an hex color string.
Note
Supported formats:
RGB
,#RGB
,RGBA
,#RGBA
,RRGGBB
,#RRGGBB
,RRGGBBAA
,#RRGGBBAA
).
-
Mechanica
Blends two colors together.
Note
The sum of the two percentages must be 1.0 otherwise the blendind operation is not executed.