UIColor

Undocumented

  • Construct a UIColor using an HTML/CSS RGB formatted value and an alpha value

    Declaration

    Swift

    public class func colorWithRGB(rgbValue : UInt, alpha : CGFloat = 1.0) -> UIColor

    Parameters

    rgbValue

    rgb value

    alpha

    color alpha

    Return Value

    UIColor instance

  • Construct a UIColor by hex string. The hex string can start with # or without #

    Declaration

    Swift

    public class func colorWithHexString(_ hexString: String, alpha: CGFloat) -> UIColor?

    Parameters

    hexString

    6 characters hexstring if without hash, or 7 characters with hash

    alpha

    alpha value

    Return Value

    UIColor

  • Returns a lighter color by the provided percentage

    Declaration

    Swift

    public func lighterColor(percent : Double) -> UIColor

    Parameters

    percent

    lighting percentage

    Return Value

    lighter UIColor

  • Returns a darker color by the provided percentage

    Declaration

    Swift

    public func darkerColor(percent : Double) -> UIColor

    Parameters

    percent

    darker percentage

    Return Value

    darker UIColor

  • Return a modified color using the brightness factor provided

    Declaration

    Swift

    public func colorWithBrightnessFactor(factor: CGFloat) -> UIColor

    Parameters

    factor

    brightness factor

    Return Value

    modified color