39 var _redComponent = 0,
44 var _hueComponent = 0,
45 _saturationComponent = 1,
46 _brightnessComponent = 2;
97 @"alternate-selected-control-color": [
CPNull null],
98 @"secondary-selected-control-color": [
CPNull null],
99 @"selected-text-background-color": [
CPNull null],
100 @"selected-text-inactive-background-color": [
CPNull null],
107 #pragma mark Static methods 122 + (
CPColor)colorWithRed:(
float)red green:(
float)green blue:(
float)blue alpha:(
float)alpha
124 return [[
CPColor alloc] _initWithRGBA:[MAX(0.0, MIN(1.0, red)), MAX(0.0, MIN(1.0, green)), MAX(0.0, MIN(1.0, blue)), MAX(0.0, MIN(1.0, alpha))]];
142 + (
CPColor)colorWithCalibratedRed:(
float)red green:(
float)green blue:(
float)blue alpha:(
float)alpha
157 + (
CPColor)colorWithWhite:(
float)white alpha:(
float)alpha
159 return [[
CPColor alloc] _initWithRGBA:[white, white, white, alpha]];
173 + (
CPColor)colorWithCalibratedWhite:(
float)white alpha:(
float)alpha
191 + (
CPColor)colorWithHue:(
float)hue saturation:(
float)saturation brightness:(
float)brightness
201 + (
CPColor)colorWithCalibratedHue:(
float)hue saturation:(
float)saturation brightness:(
float)brightness alpha:(
float)alpha
220 + (
CPColor)colorWithHue:(
float)hue saturation:(
float)saturation brightness:(
float)brightness alpha:(
float)alpha
223 hue = MAX(MIN(hue, 1.0), 0.0);
224 saturation = MAX(MIN(saturation, 1.0), 0.0);
225 brightness = MAX(MIN(brightness, 1.0), 0.0);
227 if (saturation === 0.0)
230 var f = (hue * 360) % 60,
231 p = (brightness * (1 - saturation)),
232 q = (brightness * (60 - saturation * f)) / 60,
233 t = (brightness * (60 - saturation * (60 - f))) / 60,
236 switch (FLOOR(hue * 6))
266 var rgba = hexToRGB(hex);
267 return rgba ? [[
CPColor alloc] _initWithRGBA: rgba] : null;
274 + (
CPColor)colorWithSRGBRed:(
float)red green:(
float)green blue:(
float)blue alpha:(
float)alpha
286 if (!cachedBlackColor)
287 cachedBlackColor = [[
CPColor alloc] _initWithRGBA:[0.0, 0.0, 0.0, 1.0]];
289 return cachedBlackColor;
297 if (!cachedBlueColor)
298 cachedBlueColor = [[
CPColor alloc] _initWithRGBA:[0.0, 0.0, 1.0, 1.0]];
300 return cachedBlueColor;
308 if (!cachedDarkGrayColor)
311 return cachedDarkGrayColor;
319 if (!cachedGrayColor)
322 return cachedGrayColor;
330 if (!cachedGreenColor)
331 cachedGreenColor = [[
CPColor alloc] _initWithRGBA:[0.0, 1.0, 0.0, 1.0]];
333 return cachedGreenColor;
341 if (!cachedLightGrayColor)
344 return cachedLightGrayColor;
353 cachedRedColor = [[
CPColor alloc] _initWithRGBA:[1.0, 0.0, 0.0, 1.0]];
355 return cachedRedColor;
363 if (!cachedWhiteColor)
364 cachedWhiteColor = [[
CPColor alloc] _initWithRGBA:[1.0, 1.0, 1.0, 1.0]];
366 return cachedWhiteColor;
374 if (!cachedYellowColor)
375 cachedYellowColor = [[
CPColor alloc] _initWithRGBA:[1.0, 1.0, 0.0, 1.0]];
377 return cachedYellowColor;
385 if (!cachedBrownColor)
386 cachedBrownColor = [[
CPColor alloc] _initWithRGBA:[0.6, 0.4, 0.2, 1.0]];
388 return cachedBrownColor;
396 if (!cachedCyanColor)
397 cachedCyanColor = [[
CPColor alloc] _initWithRGBA:[0.0, 1.0, 1.0, 1.0]];
399 return cachedCyanColor;
407 if (!cachedMagentaColor)
408 cachedMagentaColor = [[
CPColor alloc] _initWithRGBA:[1.0, 0.0, 1.0, 1.0]];
410 return cachedMagentaColor;
418 if (!cachedOrangeColor)
419 cachedOrangeColor = [[
CPColor alloc] _initWithRGBA:[1.0, 0.5, 0.0, 1.0]];
421 return cachedOrangeColor;
429 if (!cachedPurpleColor)
430 cachedPurpleColor = [[
CPColor alloc] _initWithRGBA:[0.5, 0.0, 0.5, 1.0]];
432 return cachedPurpleColor;
441 if (!cachedShadowColor)
442 cachedShadowColor = [[
CPColor alloc] _initWithRGBA:[0.0, 0.0, 0.0, 1.0 / 3.0]];
444 return cachedShadowColor;
453 if (!cachedClearColor)
456 return cachedClearColor;
461 if (!cachedThemeColor)
462 cachedThemeColor = [
self colorWithCalibratedWhite:0.0 alpha:0.0];
464 return cachedThemeColor;
469 return [[
self _cachedThemeColor] valueForThemeAttribute:@"alternate-selected-control-color"];
474 return [[
self _cachedThemeColor] valueForThemeAttribute:@"secondary-selected-control-color"];
484 return [[
CPColor alloc] _initWithPatternImage:anImage];
495 return [[
CPColor alloc] _initWithCSSString: aString];
500 return [[
self _cachedThemeColor] valueForThemeAttribute:@"selected-text-background-color"] || [
CPColor colorWithHexString:"99CCFF"];
503 + (
CPColor)_selectedTextBackgroundColorUnfocussed
505 return [[
self _cachedThemeColor] valueForThemeAttribute:@"selected-text-inactive-background-color"] || [
CPColor colorWithHexString:"CCCCCC"];
509 - (id)_initWithCSSString:(
CPString)aString
516 var startingIndex = aString.indexOf(
"("),
517 parts = aString.substring(startingIndex + 1).split(
',');
520 parseInt(parts[0], 10) / 255.0,
521 parseInt(parts[1], 10) / 255.0,
522 parseInt(parts[2], 10) / 255.0,
523 parts[3] ? parseFloat(parts[3], 10) : 1.0
528 [
self _initCSSStringFromComponents];
531 _themeState = CPThemeStateNormal;
532 [
self _loadThemeAttributes];
538 - (id)_initWithRGBA:(CPArray)components
544 _components = components;
546 [
self _initCSSStringFromComponents];
549 _themeState = CPThemeStateNormal;
550 [
self _loadThemeAttributes];
556 - (void)_initCSSStringFromComponents
560 _cssString = (hasAlpha ?
"rgba(" :
"rgb(") +
561 parseInt(_components[0] * 255.0) + ", " +
562 parseInt(_components[1] * 255.0) + ", " +
563 parseInt(_components[2] * 255.0) +
564 (hasAlpha ? (", " + _components[3]) : "") + ")";
568 - (id)_initWithPatternImage:(
CPImage)anImage
574 _patternImage = anImage;
575 _cssString =
"url(\"" + [_patternImage filename] + "\")";
576 _components = [0.0, 0.0, 0.0, 1.0];
579 _themeState = CPThemeStateNormal;
580 [
self _loadThemeAttributes];
591 return _patternImage;
597 - (float)alphaComponent
599 return _components[3];
605 - (float)blueComponent
607 return _components[2];
613 - (float)greenComponent
615 return _components[1];
621 - (float)redComponent
623 return _components[0];
637 - (CPArray)components
649 - (
CPColor)colorWithAlphaComponent:(
float)anAlphaComponent
651 var components = _components.slice();
653 components[components.length - 1] = anAlphaComponent;
655 return [[[
self class] alloc] _initWithRGBA:components];
661 - (
CPColor)colorUsingColorSpaceName:(
id)aColorSpaceName
679 - (CPArray)hsbComponents
681 var red = ROUND(_components[_redComponent] * 255.0),
682 green = ROUND(_components[_greenComponent] * 255.0),
683 blue = ROUND(_components[_blueComponent] * 255.0);
685 var max = MAX(red, green, blue),
686 min = MIN(red, green, blue),
689 var brightness = max / 255.0,
690 saturation = (max != 0) ? delta / max : 0;
700 var rr = (max - red) / delta,
701 gr = (max - green) / delta,
702 br = (max - blue) / delta;
706 else if (green == max)
726 - (float)hueComponent
734 - (float)saturationComponent
742 - (float)brightnessComponent
766 return rgbToHex([
self redComponent], [
self greenComponent], [
self blueComponent]);
777 if (![aColor isKindOfClass:
CPColor])
780 if (_patternImage || [aColor patternImage])
786 return ROUND([
self redComponent] * 255.0) == ROUND([aColor redComponent] * 255.0) &&
787 ROUND([
self greenComponent] * 255.0) == ROUND([aColor greenComponent] * 255.0) &&
788 ROUND([
self blueComponent] * 255.0) == ROUND([aColor blueComponent] * 255.0) &&
802 if ([patternImage isThreePartImage] || [patternImage isNinePartImage])
806 if ([patternImage isThreePartImage])
809 description +=
" patternImage (" + slices.length +
" part): [\n";
811 for (var i = 0; i < slices.length; ++i)
813 var imgDescription = [slices[i] description] ||
"nil";
815 description += imgDescription.replace(/^/mg,
" ") +
",\n";
875 #pragma mark CSS Theming 942 return [[
CPColor alloc] _initWithCSSDictionary:aDictionary beforeDictionary:nil afterDictionary:nil];
947 return [[
CPColor alloc] _initWithCSSDictionary:aDictionary beforeDictionary:beforeDictionary afterDictionary:afterDictionary];
956 _cssDictionary = aDictionary;
957 _cssBeforeDictionary = beforeDictionary;
958 _cssAfterDictionary = afterDictionary;
959 _components = [0.0, 0.0, 0.0, 1.0];
962 _themeState = CPThemeStateNormal;
963 [
self _loadThemeAttributes];
971 return !!(_cssDictionary || _cssBeforeDictionary || _cssAfterDictionary);
974 - (BOOL)hasCSSDictionary
976 return ([_cssDictionary count] > 0);
979 - (BOOL)hasCSSBeforeDictionary
981 return ([_cssBeforeDictionary count] > 0);
984 - (BOOL)hasCSSAfterDictionary
986 return ([_cssAfterDictionary count] > 0);
989 - (void)restorePreviousCSSState:(CPArrayRef)aPreviousStateRef forDOMElement:(DOMElement)aDOMElement
992 var aPreviousState = @deref(aPreviousStateRef);
994 for (var i = 0, count = aPreviousState.length; i < count; i++)
995 aDOMElement.style[aPreviousState[i][0]] = aPreviousState[i][1];
997 @deref(aPreviousStateRef) = @[];
1001 - (DOMElement)applyCSSColorForView:(
CPView)aView onDOMElement:(DOMElement)aDOMElement styleNode:(DOMElement)aStyleNode previousState:(CPArrayRef)aPreviousStateRef
1004 var aPreviousState = @deref(aPreviousStateRef);
1006 [_cssDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop)
1008 [aPreviousState addObject:@[aKey, aDOMElement.style[aKey]]];
1009 aDOMElement.style[aKey] = anObject;
1012 if ([
self hasCSSBeforeDictionary] || [
self hasCSSAfterDictionary])
1016 var styleClassName =
@".CP" + [aView UID],
1019 if ([
self hasCSSBeforeDictionary])
1021 styleContent += styleClassName +
@"::before { ";
1023 [_cssBeforeDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop)
1025 styleContent += aKey + ": " + anObject + "; ";
1028 styleContent +=
"} ";
1031 if ([
self hasCSSAfterDictionary])
1033 styleContent += styleClassName +
@"::after { ";
1035 [_cssAfterDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop)
1037 styleContent += aKey + ": " + anObject + "; ";
1040 styleContent +=
"} ";
1043 var styleDescription = document.createTextNode(styleContent);
1047 aStyleNode = document.createElement(
"style");
1049 aView._DOMElement.insertBefore(aStyleNode, aView._DOMElement.firstChild);
1051 aStyleNode.appendChild(styleDescription);
1055 aStyleNode.replaceChild(styleDescription, aStyleNode.firstChild);
1066 aView._DOMElement.removeChild(aStyleNode);
1073 @deref(aPreviousStateRef) = aPreviousState;
1084 var CPColorComponentsKey =
@"CPColorComponentsKey",
1085 CPColorPatternImageKey =
@"CPColorPatternImageKey",
1086 CPColorCssDictionaryKey =
@"CPColorCssDictionaryKey",
1087 CPColorCssBeforeDictionaryKey =
@"CPColorCssBeforeDictionaryKey",
1088 CPColorCssAfterDictionaryKey =
@"CPColorCssAfterDictionaryKey";
1099 if ([aCoder containsValueForKey:CPColorPatternImageKey])
1100 self = [
self _initWithPatternImage:[aCoder decodeObjectForKey:CPColorPatternImageKey]];
1101 else if ([aCoder containsValueForKey:CPColorCssDictionaryKey])
1102 self = [
self _initWithCSSDictionary:[aCoder decodeObjectForKey:CPColorCssDictionaryKey]
1103 beforeDictionary:[aCoder decodeObjectForKey:CPColorCssBeforeDictionaryKey]
1104 afterDictionary:[aCoder decodeObjectForKey:CPColorCssAfterDictionaryKey]];
1106 self = [
self _initWithRGBA:[aCoder decodeObjectForKey:CPColorComponentsKey]];
1108 [
self _decodeThemeObjectsWithCoder:aCoder];
1120 [aCoder encodeObject:_patternImage forKey:CPColorPatternImageKey];
1121 else if (_cssDictionary)
1123 [aCoder encodeObject:_cssDictionary forKey:CPColorCssDictionaryKey];
1124 [aCoder encodeObject:_cssBeforeDictionary forKey:CPColorCssBeforeDictionaryKey];
1125 [aCoder encodeObject:_cssAfterDictionary forKey:CPColorCssAfterDictionaryKey];
1128 [aCoder encodeObject:_components forKey:CPColorComponentsKey];
1130 [
self _encodeThemeObjectsWithCoder:aCoder];
1137 var hexCharacters =
"0123456789ABCDEF";
1143 var hexToRGB =
function(hex)
1145 if (hex.length == 3)
1146 hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2);
1148 if (hex.length != 6)
1151 hex = hex.toUpperCase();
1153 for (var i = 0; i < hex.length; i++)
1154 if (hexCharacters.indexOf(hex.charAt(i)) == -1)
1157 var red = (hexCharacters.indexOf(hex.charAt(0)) * 16 + hexCharacters.indexOf(hex.charAt(1))) / 255.0,
1158 green = (hexCharacters.indexOf(hex.charAt(2)) * 16 + hexCharacters.indexOf(hex.charAt(3))) / 255.0,
1159 blue = (hexCharacters.indexOf(hex.charAt(4)) * 16 + hexCharacters.indexOf(hex.charAt(5))) / 255.0;
1161 return [red, green, blue, 1.0];
1164 var rgbToHex =
function(r,g,b)
1166 return byteToHex(r) + byteToHex(g) + byteToHex(b);
1169 var byteToHex =
function(n)
1174 n = FLOOR(MIN(255, MAX(0, 256 * n)));
1176 return hexCharacters.charAt((n - n % 16) / 16) +
1177 hexCharacters.charAt(n % 16);
1399 function CPColorWithImages()
1405 args = Array.prototype.slice.apply(arguments);
1407 if (typeof(args[args.length - 1]) ===
"function")
1408 imageFactory = args.pop();
1410 switch (args.length)
1413 return imageFromSlices(args[0], isVertical, imageFactory);
1417 if (typeof(args[0]) ===
"string")
1418 return patternColorsFromPattern.call(
this, args[0], args[1], imageFactory);
1420 return imageFromSlices(args[0], args[1], imageFactory);
1427 throw(
"ERROR: Invalid argument count: " + args.length);
1431 var imageFromSlices =
function(slices, isVertical, imageFactory)
1433 var imageSlices = [];
1435 for (var i = 0; i < slices.length; ++i)
1437 var slice = slices[i];
1439 imageSlices.push(slice ? imageFactory(slice[0], slice[1], slice[2], slice[3]) : nil);
1442 switch (slices.length)
1451 throw(
"ERROR: Invalid number of image slices: " + slices.length);
1455 var patternColorsFromPattern =
function(pattern, attributes, imageFactory)
1457 if (pattern.match(/^.*\{[^}]+\}/))
1459 var
width = attributes["width"],
1460 height = attributes["height"],
1461 separator = attributes["separator"] ||
"-",
1462 orientation = attributes["orientation"],
1471 if (pattern.indexOf(
"{position}") < 0)
1472 throw(
"ERROR: Pattern strings must have a {position} placeholder (\"" + pattern +
"\")");
1474 if (orientation === undefined)
1478 if (attributes[
"centerIsNil"] !== undefined)
1479 centerIsNil = attributes["centerIsNil"];
1484 isVertical = orientation === PatternIsVertical;
1488 if (attributes[
"centerHeight"])
1489 centerWidthHeight = attributes["centerHeight"];
1493 if (attributes[
"centerWidth"])
1494 centerWidthHeight = attributes["centerWidth"];
1498 if (attributes[
"rightWidth"])
1499 rightWidth = attributes["rightWidth"];
1501 if (attributes[
"bottomHeight"])
1504 var positions = attributes["positions"] ||
"@",
1510 if (positions ===
"@")
1513 positions = ["top", "center", "bottom"];
1515 positions = ["left", "center", "right"];
1517 else if (positions ===
"#")
1518 positions = ["0", "1", "2"];
1520 throw(
"ERROR: Invalid positions: " + positions)
1524 if (positions ===
"@" || positions ===
"abbrev")
1525 positions = ["top-left", "top", "top-right", "left", "center", "right", "bottom-left", "bottom", "bottom-right"];
1526 else if (positions ===
"full")
1527 positions = ["top-left", "top-center", "top-right", "center-left", "center-center", "center-right", "bottom-left", "bottom-center", "bottom-right"];
1528 else if (positions ===
"#")
1529 positions = ["0", "1", "2", "3", "4", "5", "6", "7", "8"];
1531 throw(
"ERROR: Invalid positions: " + positions)
1535 if (pattern.indexOf(
"{state}") >= 0)
1537 states = attributes["states"];
1540 throw(
"ERROR: {state} placeholder in the pattern (\"" + pattern +
"\") but no states item in the attributes");
1544 if (pattern.indexOf(
"{style}") >= 0)
1546 styles = attributes["styles"];
1549 throw(
"ERROR: {style} placeholder in the pattern (\"" + pattern +
"\") but no styles item in the attributes");
1553 var placeholder =
"{position}",
1554 pos = pattern.indexOf(placeholder),
1557 for (i = 0; i < positions.length; ++i)
1558 positions[i] = pattern.replace(placeholder, pos === 0 ? positions[i] + separator : separator + positions[i]);
1560 var slices = positions,
1567 placeholder =
"{state}";
1568 pos = pattern.indexOf(placeholder);
1571 for (i = 0; i < states.length; ++i)
1573 var state = states[i];
1575 sep = state ? separator :
"";
1577 object[key] = slices.slice(0);
1578 replacePlaceholderInArray(
object[key], placeholder, pos === 0 ? state + sep : sep + state);
1584 placeholder =
"{style}";
1585 pos = pattern.indexOf(placeholder);
1587 var styleObject = {};
1589 for (i = 0; i < styles.length; ++i)
1591 var style = styles[i];
1593 sep = style ? separator :
"";
1597 styleObject[key] = cloneObject(
object);
1598 replacePlaceholderInObject(styleObject[key], placeholder, pos === 0 ? style + sep : sep + style);
1602 styleObject[key] = slices.slice(0);
1603 replacePlaceholderInArray(styleObject[key], placeholder, pos === 0 ? style + sep : sep + style);
1607 object = styleObject;
1610 if (styles || states)
1613 makeThreePartSlicesFromObject(
object,
width, height, centerWidthHeight, rightWidth,
bottomHeight, isVertical);
1615 makeNinePartSlicesFromObject(
object,
width, height, rightWidth,
bottomHeight, centerIsNil);
1617 makeImagesFromObject(
object, isVertical, imageFactory);
1623 makeThreePartSlicesFromArray(
object,
width, height, centerWidthHeight, rightWidth,
bottomHeight, isVertical);
1625 makeNinePartSlicesFromArray(
object,
width, height, rightWidth,
bottomHeight, centerIsNil);
1627 return imageFromSlices(
object, isVertical, imageFactory);
1631 throw(
"ERROR: No placeholders in slice pattern (\"" + pattern +
"\")");
1634 var replacePlaceholderInArray =
function(array, find, replacement)
1636 for (var i = 0; i < array.length; ++i)
1637 array[i] = array[i].replace(find, replacement);
1640 var replacePlaceholderInObject =
function(object, find, replacement)
1642 for (var key in
object)
1643 if (
object.hasOwnProperty(key))
1644 if (
object[key].constructor === Array)
1645 replacePlaceholderInArray(
object[key], find, replacement);
1647 replacePlaceholderInObject(
object[key], find, replacement);
1650 var cloneObject =
function(object)
1654 for (var key in
object)
1655 if (
object.hasOwnProperty(key))
1656 if (
object[key].constructor === Array)
1657 clone[key] =
object[key].slice(0);
1658 else if (typeof(
object[key]) ===
"object")
1659 clone[key] = cloneObject(
object[key]);
1661 clone[key] =
object[key];
1666 var makeThreePartSlicesFromObject =
function(object,
width, height, centerWidthHeight, rightWidth,
bottomHeight, isVertical)
1668 for (var key in
object)
1669 if (
object.hasOwnProperty(key))
1670 if (
object[key].constructor === Array)
1671 makeThreePartSlicesFromArray(
object[key],
width, height, centerWidthHeight, rightWidth,
bottomHeight, isVertical);
1673 makeThreePartSlicesFromObject(
object[key],
width, height, centerWidthHeight, rightWidth,
bottomHeight, isVertical);
1676 var makeThreePartSlicesFromArray =
function(array,
width, height, centerWidthHeight, rightWidth,
bottomHeight, isVertical)
1678 array[0] = [array[0], width, height];
1682 array[1] = [array[1], width, centerWidthHeight ? centerWidthHeight : 1.0];
1683 array[2] = [array[2], width, bottomHeight ? bottomHeight : height];
1687 array[1] = [array[1], centerWidthHeight ? centerWidthHeight : 1.0, height];
1688 array[2] = [array[2], rightWidth ? rightWidth : width, height];
1692 var makeNinePartSlicesFromObject =
function(object,
width, height, rightWidth,
bottomHeight, centerIsNil)
1694 for (var key in
object)
1695 if (
object.hasOwnProperty(key))
1696 if (
object[key].constructor === Array)
1697 makeNinePartSlicesFromArray(
object[key],
width, height, rightWidth,
bottomHeight, centerIsNil);
1699 makeNinePartSlicesFromObject(
object[key],
width, height, rightWidth,
bottomHeight, centerIsNil);
1702 var makeNinePartSlicesFromArray =
function(array,
width, height, rightWidth,
bottomHeight, centerIsNil)
1704 rightWidth = rightWidth ? rightWidth :
width;
1707 array[0] = [array[0], width, height];
1708 array[1] = [array[1], 1.0, height];
1709 array[2] = [array[2], rightWidth, height];
1710 array[3] = [array[3], width, 1.0];
1711 array[4] = centerIsNil ? nil : [array[4], 1.0, 1.0];
1712 array[5] = [array[5], rightWidth, 1.0];
1713 array[6] = [array[6], width, bottomHeight];
1714 array[7] = [array[7], 1.0, bottomHeight];
1715 array[8] = [array[8], rightWidth, bottomHeight];
1718 var makeImagesFromObject =
function(object, isVertical, imageFactory)
1720 for (var key in
object)
1721 if (
object.hasOwnProperty(key))
1722 if (
object[key].constructor === Array)
1723 object[key] = imageFromSlices(
object[key], isVertical, imageFactory);
1725 makeImagesFromObject(
object[key], isVertical, imageFactory);
function CPImageInBundle()
id initWithImageSlices:isVertical:(CPArray imageSlices, [isVertical] BOOL isVertical)
CPColor colorWithHexString:(string hex)
CPGraphicsContext currentContext()
An object representation of nil.
CPColor colorWithPatternImage:(CPImage anImage)
function CGContextSetStrokeColor(aContext, aColor)
CPColor colorWithCalibratedRed:green:blue:alpha:(float red, [green] float green, [blue] float blue, [alpha] float alpha)
id initWithImageSlices:(CPArray imageSlices)
A mutable key-value pair collection.
An immutable string (collection of characters).
if(CPFeatureIsCompatible(CPHTMLCanvasFeature))
function CPFeatureIsCompatible(aFeature)
CPColor colorWithCalibratedWhite:alpha:(float white, [alpha] float alpha)
CPColor colorWithRed:green:blue:alpha:(float red, [green] float green, [blue] float blue, [alpha] float alpha)
function CGContextSetFillColor(aContext, aColor)
CPColor colorWithHue:saturation:brightness:alpha:(float hue, [saturation] float saturation, [brightness] float brightness, [alpha] float alpha)
id initWithContentsOfFile:(CPString aFilename)
CPColorPatternIsHorizontal
CPColor colorWithWhite:alpha:(float white, [alpha] float alpha)
void setDOMClassName:(CPString aClassName)
Defines methods for use when archiving & restoring (enc/decoding).
FrameUpdater prototype description