00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 @import "CGColor.j"
00024 @import "CGColorSpace.j"
00025
00026
00027 kCGGradientDrawsBeforeStartLocation = 1 << 0;
00028 kCGGradientDrawsAfterEndLocation = 1 << 1;
00029
00030 function CGGradientCreateWithColorComponents(aColorSpace, components, locations, count)
00031 {
00032 if (arguments["count"] == NULL)
00033 var count = locations.length;
00034
00035 var colors = [];
00036
00037 while (count--)
00038 {
00039 var offset = count * 4;
00040 colors[count] = CGColorCreate(aColorSpace, components.slice(offset, offset + 4));
00041 }
00042
00043 return CGGradientCreateWithColors(aColorSpace, colors, locations);
00044 }
00045
00046 function CGGradientCreateWithColors(aColorSpace, colors, locations)
00047 {
00048 return { colorspace:aColorSpace, colors:colors, locations:locations };
00049 }
00050
00051 function CGGradientRelease()
00052 {
00053 }
00054
00055 function CGGradientRetain(aGradient)
00056 {
00057 return aGradient;
00058 }