![]() |
API 0.9.5
|
#import <CPColor.h>
CPColor
can be used to represent color in an RGB or HSB model with an optional transparency value.
It also provides some class helper methods that returns instances of commonly used colors.
- (float) alphaComponent |
+ (CPColor) blackColor |
+ (CPColor) blueColor |
- (float) blueComponent |
+ (CPColor) brownColor |
+ (CPColor) clearColor |
- (CPColor) colorWithAlphaComponent: | (float) | anAlphaComponent |
+ (CPColor) colorWithCalibratedRed: | (float) | red | |
green: | (float) | green | |
blue: | (float) | blue | |
alpha: | (float) | alpha | |
Creates a color in the RGB color space, with an alpha value. Each component should be between the range of 0.0 to 1.0. For the alpha component, a value of 1.0 is opaque, and 0.0 means completely transparent.
red | the red component of the color |
green | the green component of the color |
blue | the blue component of the color |
alpha | the alpha component |
+ (CPColor) colorWithCalibratedWhite: | (float) | white | |
alpha: | (float) | alpha | |
Creates a new color object with white
for the RGB components. For the alpha component, a value of 1.0 is opaque, and 0.0 means completely transparent.
white | a float between 0.0 and 1.0 |
alpha | the alpha component between 0.0 and 1.0 |
+ (CPColor) colorWithHexString: | (string) | hex |
Creates an RGB color from a hexadecimal string. For example, the a string of "FFFFFF" would return a white CPColor. "FF0000" would return a pure red, "00FF00" would return a pure blue, and "0000FF" would return a pure green.
hex | a 6 character long string of hex |
+ (CPColor) colorWithHue: | (float) | hue | |
saturation: | (float) | saturation | |
brightness: | (float) | brightness | |
+ (CPColor) colorWithHue: | (float) | hue | |
saturation: | (float) | saturation | |
brightness: | (float) | brightness | |
alpha: | (float) | alpha | |
+ (CPColor) colorWithRed: | (float) | red | |
green: | (float) | green | |
blue: | (float) | blue | |
alpha: | (float) | alpha | |
Creates a color in the RGB color space, with an alpha value. Each component should be between the range of 0.0 to 1.0. For the alpha component, a value of 1.0 is opaque, and 0.0 means completely transparent.
red | the red component of the color |
green | the green component of the color |
blue | the blue component of the color |
alpha | the alpha component |
+ (CPColor) colorWithWhite: | (float) | white | |
alpha: | (float) | alpha | |
Creates a new color object with white
for the RGB components. For the alpha component, a value of 1.0 is opaque, and 0.0 means completely transparent.
white | a float between 0.0 and 1.0 |
alpha | the alpha component between 0.0 and 1.0 |
- (CPArray) components |
- (CPString) cssString |
+ (CPColor) cyanColor |
+ (CPColor) darkGrayColor |
- (void) encodeWithCoder: | (CPCoder) | aCoder |
+ (CPColor) grayColor |
+ (CPColor) greenColor |
- (float) greenComponent |
- (CPString) hexString |
- (CPArray) hsbComponents |
- (id) initWithCoder: | (CPCoder) | aCoder |
+ (CPColor) lightGrayColor |
+ (CPColor) magentaColor |
+ (CPColor) orangeColor |
- (CPImage) patternImage |
+ (CPColor) purpleColor |
+ (CPColor) redColor |
- (float) redComponent |
- (void) set |
- (void) setFill |
- (void) setStroke |
+ (CPColor) shadowColor |
+ (CPColor) whiteColor |
+ (CPColor) yellowColor |