UIColor(HBAdditions)

@interface UIColor (HBAdditions)

UIColor (HBAdditions) is a class category in Cephei that provides some convenience methods.

  • Creates and returns a color object using data from the specified object.

    The value is expected to be one of the types specified in hb_initWithPropertyListValue:.

    See

    hb_initWithPropertyListValue:

    Declaration

    Objective-C

    + (nonnull instancetype)hb_colorWithPropertyListValue:(nonnull id)value;

    Swift

    class func hb_color(withPropertyListValue value: Any) -> Self

    Parameters

    value

    The object to retrieve data from. See the discussion for the supported object types.

    Return Value

    The color object. The color information represented by this object is in the device RGB colorspace.

  • Initializes and returns a color object using data from the specified object.

    The value is expected to be one of:

    • An array of 3 or 4 integer RGB or RGBA color components, with values between 0 and 255 (e.g. @[ 218, 192, 222 ])
    • A CSS-style hex string, with an optional alpha component (e.g. #DAC0DE or #DACODE55)
    • A short CSS-style hex string, with an optional alpha component (e.g. #DC0 or #DC05)

    Declaration

    Objective-C

    - (nonnull instancetype)hb_initWithPropertyListValue:(nonnull id)value;

    Swift

    func hb_init(withPropertyListValue value: Any) -> Self

    Parameters

    value

    The object to retrieve data from. See the discussion for the supported object types.

    Return Value

    An initialized color object. The color information represented by this object is in the device RGB colorspace.