Instance Methods | |
(float) | - alphaComponent |
(DOMElement) | - applyCSSColorForView:onDOMElement:styleNode:previousState: |
(float) | - blueComponent |
(float) | - brightnessComponent |
(CPColor) | - colorUsingColorSpaceName: |
(CPColor) | - colorWithAlphaComponent: |
(CPArray) | - components |
(CPString) | - cssString |
(CPString) | - description |
(void) | - encodeWithCoder: |
(float) | - greenComponent |
(BOOL) | - hasCSSAfterDictionary |
(BOOL) | - hasCSSBeforeDictionary |
(BOOL) | - hasCSSDictionary |
(CPString) | - hexString |
(CPArray) | - hsbComponents |
(float) | - hueComponent |
(id) | - initWithCoder: |
(BOOL) | - isCSSBased |
(BOOL) | - isEqual: |
(CPImage) | - patternImage |
(float) | - redComponent |
(void) | - restorePreviousCSSState:forDOMElement: |
(float) | - saturationComponent |
(void) | - set |
(void) | - setFill |
(void) | - setStroke |
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.
|
implementation |
|
implementation |
Provided by category CPColor(CSSTheming).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Provided by category CPColor(Debugging).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Creates a color in the RGB colorspace, 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 |
|
implementation |
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 |
|
implementation |
Provided by category CPColor(CSSTheming).
|
implementation |
Provided by category CPColor(CSSTheming).
|
implementation |
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 |
|
implementation |
Creates a new color based on the given HSB components.
Note: earlier versions of this method took a hue component as degrees between 0-360, and saturation and brightness components as percent between 0-100. This method has now been corrected to take all components in the 0-1 range as in Cocoa.
hue | the hue component (0.0-1.0) |
saturation | the saturation component (0.0-1.0) |
brightness | the brightness component (0.0-1.0) |
|
implementation |
Creates a new color based on the given HSB components.
Note: earlier versions of this method took a hue component as degrees between 0-360, and saturation and brightness components as percent between 0-100. This method has now been corrected to take all components in the 0-1 range as in Cocoa.
hue | the hue component (0.0-1.0) |
saturation | the saturation component (0.0-1.0) |
brightness | the brightness component (0.0-1.0) |
alpha | the opacity component (0.0-1.0) |
|
implementation |
Creates a color in the RGB colorspace, 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 |
|
implementation |
|
implementation |
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 |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Archives this color into a coder.
aCoder | the coder into which the color will be archived. |
Provided by category CPColor(CPCoding).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Provided by category CPColor(CSSTheming).
|
implementation |
Provided by category CPColor(CSSTheming).
|
implementation |
Provided by category CPColor(CSSTheming).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Initializes this color from the data archived in a coder.
aCoder | the coder from which the color will be loaded |
Provided by category CPColor(CPCoding).
|
implementation |
Provided by category CPColor(CSSTheming).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Provided by category CPColor(Debugging).
|
implementation |
|
implementation |
|
implementation |
Provided by category CPColor(CSSTheming).
|
implementation |
|
implementation |
Set's the receiver to be the fill and stroke color in the current graphics context
Provided by category CPColor(CoreGraphicsExtensions).
|
implementation |
Set's the receiver to be the fill color in the current graphics context
Provided by category CPColor(CoreGraphicsExtensions).
|
implementation |
Set's the receiver to be the stroke color in the current graphics context
Provided by category CPColor(CoreGraphicsExtensions).
|
implementation |
|
implementation |
|
implementation |
|
implementation |