UIColor

public extension UIColor

Extension for UIColor functionality.

Public Init

  • Extends the functionality of a UIColor with the ability to init it with hex string.

    Declaration

    Swift

    convenience init(hexString: String)

    Parameters

    hexString

    The String Object. The hex string to init UIColor.

Public Methods

  • Extends the functionality of a UIColor with the ability to convert it to hex string.

    Declaration

    Swift

    func toHexString() -> String

    Return Value

    The String Object that contains a color in hex format.

  • Extends the functionality of a UIColor with the ability to use color asset for all iOS Versions, iOS 13+ by name and older by base color.

    Declaration

    Swift

    static func colorAsset(name colorAssetName: String, baseColor: UIColor, aboveiOS11Mock: Bool = true) -> UIColor

    Parameters

    colorAssetName

    The String Object. The name for color asset used for dark mode in iOS 13 and higher.

    baseColor

    The UIColor Object. The color used as base color for iOS versions below iOS 13.

    Return Value

    The UIColor Object.