iOS Charting Documentation - SciChart iOS Charts SDK v3.x

UIColor(Util)

@interface UIColor (Util)

Helper category with some color constants and helper methods to work with UIColor.

  • Get hex color code from UIColor. Color code bytes order is 0xAABBGGRR.

    Declaration

    Objective-C

    - (unsigned int)colorABGRCode;

    Swift

    func colorABGRCode() -> UInt32
  • Get hex color code from UIColor. Color code bytes order is 0xAARRGGBB.

    Declaration

    Objective-C

    - (unsigned int)colorARGBCode;

    Swift

    func colorARGBCode() -> UInt32
  • Create UIColor from hex color code. Color code bytes order is 0xAABBGGRR.

    Declaration

    Objective-C

    + (UIColor *)fromABGRColorCode:(unsigned int)color;

    Swift

    class func fromABGRColorCode(_ color: UInt32) -> UIColor!
  • Create UIColor from hex color code. Color code bytes order is 0xAARRGGBB.

    Declaration

    Objective-C

    + (UIColor *)fromARGBColorCode:(unsigned int)color;

    Swift

    class func fromARGBColorCode(_ color: UInt32) -> UIColor!
  • Applies specified opacity value to provided color.

    Declaration

    Objective-C

    + (unsigned int)argb:(unsigned int)color withOpacity:(float)opacity;

    Swift

    class func argb(_ color: UInt32, withOpacity opacity: Float) -> UInt32

    Parameters

    color

    The input color.

    opacity

    The opacity value.

    Return Value

    The output color.

  • Swap bytes from ARGB into ABGR.

    Declaration

    Objective-C

    + (unsigned int)swapBytesFromARGBIntoABGR:(unsigned int)argb;

    Swift

    class func swapBytesFromARGB(intoABGR argb: UInt32) -> UInt32
  • Gets alpha value from color.

    Declaration

    Objective-C

    + (unsigned char)alpha:(unsigned int)color;

    Swift

    class func alpha(_ color: UInt32) -> UInt8

    Parameters

    color

    The color value.

    Return Value

    The alpha value.

  • Gets red value from color.

    Declaration

    Objective-C

    + (unsigned char)red:(unsigned int)color;

    Swift

    class func red(_ color: UInt32) -> UInt8

    Parameters

    color

    The color value.

    Return Value

    The red value.

  • Gets green value from color.

    Declaration

    Objective-C

    + (unsigned char)green:(unsigned int)color;

    Swift

    class func green(_ color: UInt32) -> UInt8

    Parameters

    color

    The color value.

    Return Value

    The green value.

  • Gets blue value from color.

    Declaration

    Objective-C

    + (unsigned char)blue:(unsigned int)color;

    Swift

    class func blue(_ color: UInt32) -> UInt8

    Parameters

    color

    The color value.

    Return Value

    The blue value.

  • Gets the inverted color for provided color.

    Declaration

    Objective-C

    + (unsigned int)getInvertedColor:(unsigned int)color;

    Swift

    class func getInvertedColor(_ color: UInt32) -> UInt32

    Parameters

    color

    The input color.

    Return Value

    The inverted color.

  • Check is the passed in color is transparent.

    Declaration

    Objective-C

    + (BOOL)isTransparent:(unsigned int)color;

    Swift

    class func isTransparent(_ color: UInt32) -> Bool

    Parameters

    color

    The color value.

    Return Value

    YES if the color is transparent, otherwise - NO.