CLIColor

@interface CLIColor : NSObject

This class represents an NSColor replacement for CLI projects that don’t link with AppKit

  • Convenience method for creating a CLIColor instance from RGBA params

    Declaration

    Objective-C

    + (nonnull instancetype)colorWithCalibratedRed:(CGFloat)red
                                             green:(CGFloat)green
                                              blue:(CGFloat)blue
                                             alpha:(CGFloat)alpha;

    Parameters

    red

    red channel, between 0 and 1

    green

    green channel, between 0 and 1

    blue

    blue channel, between 0 and 1

    alpha

    alpha channel, between 0 and 1

  • Get the RGBA components from a CLIColor

    Declaration

    Objective-C

    - (void)getRed:(nullable CGFloat *)red
             green:(nullable CGFloat *)green
              blue:(nullable CGFloat *)blue
             alpha:(nullable CGFloat *)alpha;

    Parameters

    red

    red channel, between 0 and 1

    green

    green channel, between 0 and 1

    blue

    blue channel, between 0 and 1

    alpha

    alpha channel, between 0 and 1