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.

  • 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

    Returns the components that make up the color in the HSBA color space.