UIColor

class UIColor : NSObject, NSSecureCoding, NSCopying

Extensions for UIColor class.

  • Initialiser color from hex representable.

    Declaration

    Swift

    public convenience init(hex: String)
  • Changing the color by making it more lighter and returns it. Optional parameter, representing by percentage.

    Declaration

    Swift

    public func lighter(by percentage: CGFloat = 0.1) -> UIColor
  • Changing the color by making it more darker and returns it. Optional parameter, representing by percentage.

    Declaration

    Swift

    public func darker(by percentage: CGFloat = 0.1) -> UIColor
  • hex

    String hex representable of color.

    Declaration

    Swift

    public var hex: String { get }