UIColor

public extension UIColor
  • Init color from 0-255 RGB components

    Declaration

    Swift

    convenience init(red: Int, green: Int, blue: Int)
  • Init color from hex value

    Declaration

    Swift

    convenience init(hex: Int)
  • Return lighter color. 1.0 - white, 0.0 - same as receiver.

    Declaration

    Swift

    func lighterColor(amount: CGFloat) -> UIColor

Average Color

  • Return average color by combining averages for red, green, blue and alpha components.

    Declaration

    Swift

    static func hexAverage(colors: [UIColor]) -> UIColor
  • Returns average color by combining averages of hue, saturation, brightness and alpha components. This one is close to human understanable average.

    Declaration

    Swift

    static func hueAverage(colors: [UIColor]) -> UIColor