]> git.parisson.com Git - pdf.js.git/commitdiff
Add comments, fix default color.
authorBrendan Dahl <brendan.dahl@gmail.com>
Thu, 10 Nov 2011 22:23:58 +0000 (14:23 -0800)
committerBrendan Dahl <brendan.dahl@gmail.com>
Thu, 10 Nov 2011 22:23:58 +0000 (14:23 -0800)
src/colorspace.js

index 953bd1c2e18107917f05719703fe6f54332c5efa..b369d0f884fe3f26d25b4840c656e4e2fa4c1e95 100644 (file)
@@ -158,11 +158,19 @@ var ColorSpace = (function colorSpaceColorSpace() {
   return constructor;
 })();
 
+/**
+ * Alternate color space handles both Separation and DeviceN color spaces.  A
+ * Separation color space is actually just a DeviceN with one color component.
+ * Both color spaces use a tinting function to convert colors to a base color
+ * space.
+ */
 var AlternateCS = (function alternateCS() {
   function constructor(numComps, base, tintFn) {
     this.name = 'Alternate';
     this.numComps = numComps;
-    this.defaultColor = [1];
+    this.defaultColor = [];
+    for (var i = 0; i < numComps; ++i)
+      this.defaultColor.push(1);
     this.base = base;
     this.tintFn = tintFn;
   }