Model

public enum Model

Model is an enum for describing and converting color models.

  • rgb: Red, Green, Blue color representation
  • hsl: Hue, Saturation, Lightness color representation
  • hsb: Hue, Saturation, Brightness color representation
  • cmyk: Cyan, Magenta, Yellow, Key (Black) color representation
  • hex: UInt32 (hex) color representation
  • Red, Green, Blue

    Declaration

    Swift

    case rgb(CGFloat, CGFloat, CGFloat)
  • Hue, Saturation, Lightness

    Declaration

    Swift

    case hsl(CGFloat, CGFloat, CGFloat)
  • Hue, Saturation, Brightness

    Declaration

    Swift

    case hsb(CGFloat, CGFloat, CGFloat)
  • Cyan, Magenta, Yellow, Key (Black)

    Declaration

    Swift

    case cmyk(CGFloat, CGFloat, CGFloat, CGFloat)
  • UInt32 (hex)

    Declaration

    Swift

    case hex(UInt32)
  • rgb

    Returns the model as an RGB tuple

    Declaration

    Swift

    public var rgb: (r: CGFloat, g: CGFloat, b: CGFloat) { get }
  • hsl

    Returns the model as an HSL tuple

    Declaration

    Swift

    public var hsl: (h: CGFloat, s: CGFloat, l: CGFloat) { get }
  • hsb

    Returns the model as an HSB tuple

    Declaration

    Swift

    public var hsb: (h: CGFloat, s: CGFloat, b: CGFloat) { get }
  • Returns the model as a CMYK tuple

    Declaration

    Swift

    public var cmyk: (c: CGFloat, m: CGFloat, y: CGFloat, k: CGFloat) { get }
  • hex

    Returns the model as a UInt32 (hex) value

    Declaration

    Swift

    public var hex: UInt32 { get }