iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x

UIColor(Util)

@interface UIColor (Util)

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

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

    Declaration

    Objective-C

    - (unsigned int)colorABGRCode;
  • Get hex color code from Color. Color code bytes order is 0xAARRGGBB.

    Declaration

    Objective-C

    - (unsigned int)colorARGBCode;
  • Create Color from hex color code. Color code bytes order is 0xAABBGGRR.

    Declaration

    Objective-C

    + (nonnull UIColor *)fromABGRColorCode:(unsigned int)color;
  • Create Color from hex color code. Color code bytes order is 0xAARRGGBB.

    Declaration

    Objective-C

    + (nonnull UIColor *)fromARGBColorCode:(unsigned int)color;
  • Create a new Color from red, green, blue and alpha channels.

    Declaration

    Objective-C

    + (nonnull UIColor *)sci_colorWithRed:(const unsigned int)red
                                    green:(const unsigned int)green
                                     blue:(const unsigned int)blue
                                    alpha:(const unsigned int)alpha;
  • Deprecated

    SCIColor.colorWithR:G:B:A is deprecated. Please use SCIColor.sci_colorWithRed:green:blue:alpha instead

    Create a new Color from red, green, blue and alpha channels.

    Declaration

    Objective-C

    + (nonnull UIColor *)colorWithR:(const unsigned int)red
                                  G:(const unsigned int)green
                                  B:(const unsigned int)blue
                                  A:(const unsigned int)alpha;
  • Create a new Color in raw unsigned int representation from red, green, blue and alpha channels.

    Declaration

    Objective-C

    + (const unsigned int)sci_colorCodeWithRed:(const unsigned int)red
                                         green:(const unsigned int)green
                                          blue:(const unsigned int)blue
                                         alpha:(const unsigned int)alpha;
  • Deprecated

    SCIColor.colorCodeWithR:G:B:A is deprecated. Please use SCIColor.sci_colorCodeWithRed:green:blue:alpha instead

    Create a new Color in raw unsigned int representation from red, green, blue and alpha channels.

    Declaration

    Objective-C

    + (const unsigned int)colorCodeWithR:(const unsigned int)red
                                       G:(const unsigned int)green
                                       B:(const unsigned int)blue
                                       A:(const unsigned int)alpha;
  • Applies specified opacity value to provided color.

    Declaration

    Objective-C

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

    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;
  • Gets alpha value from color.

    Declaration

    Objective-C

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

    Parameters

    color

    The color value.

    Return Value

    The alpha value.

  • Gets red value from color.

    Declaration

    Objective-C

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

    Parameters

    color

    The color value.

    Return Value

    The red value.

  • Gets green value from color.

    Declaration

    Objective-C

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

    Parameters

    color

    The color value.

    Return Value

    The green value.

  • Gets blue value from color.

    Declaration

    Objective-C

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

    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;

    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;

    Parameters

    color

    The color value.

    Return Value

    YES if the color is transparent, otherwise - NO.