mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 18:52:19 +00:00
Merge branch 'CGGradientCreateWithColorComponents-location-fix' of http://github.com/eventualbuddha/cappuccino
This commit is contained in:
commit
28cf834e0b
1 file changed
+5
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user