Brian Donovan committed 2010-09-28 08:22:09 -07:00
1 parent ffcbf87858
commit 23a654d57a
1 file changed
+5 -2
+5 -2
View File
@@ -29,17 +29,20 @@ kCGGradientDrawsAfterEndLocation = 1 << 1;
function CGGradientCreateWithColorComponents(aColorSpace, components, locations, count)
{
if (arguments["locations"] == NULL)
var locations = [0.0, 1.0];
if (arguments["count"] == NULL)
var count = locations.length;
var colors = [];
while (count--)
{
var offset = count * 4;
colors[count] = CGColorCreate(aColorSpace, components.slice(offset, offset + 4));
}
return CGGradientCreateWithColors(aColorSpace, colors, locations);
}