ColorHelper

@objcMembers public class ColorHelper: NSObject

Utility class for creating UIColor instances.

  • Parses a RGB string and returns its corresponding color.

    Declaration

    Swift

    public static func makeColor(rgb: String, alpha: CGFloat = 1.0) -> UIColor?

    Return Value

    A parsed RGB color, or nil if the string could not be parsed.

  • Returns a UIColor based on a given hue, with defaults set for saturation (0.45), brightness (0.65), and alpha (1.0).

    Declaration

    Swift

    public static func makeColor(hue: CGFloat) -> UIColor

    Return Value

    A UIColor

  • Returns a UIColor based on hue, saturation, brightness, and alpha values.

    Declaration

    Swift

    public static func makeColor(
        hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat) -> UIColor

    Return Value

    A UIColor