public virtual void MakeIndexedNullColorValuesTest() { PdfArray indexed = new PdfArray(); indexed.Add(PdfName.Indexed); indexed.Add(new PdfArray()); indexed.Add(null); indexed.Add(null); PdfColorSpace colorSpace = PdfColorSpace.MakeColorSpace(indexed); Color color = Color.MakeColor(colorSpace); NUnit.Framework.Assert.IsTrue(color is Indexed); NUnit.Framework.Assert.AreEqual(new float[] { 0.0f }, color.GetColorValue()); }
public virtual void MakeDeviceNNullColorValuesTest() { PdfArray deviceN = new PdfArray(); deviceN.Add(PdfName.DeviceN); deviceN.Add(new PdfArray()); deviceN.Add(null); deviceN.Add(null); PdfColorSpace colorSpace = PdfColorSpace.MakeColorSpace(deviceN); Color color = Color.MakeColor(colorSpace); NUnit.Framework.Assert.IsTrue(color is DeviceN); NUnit.Framework.Assert.AreEqual(new float[] { }, color.GetColorValue()); }
public virtual void MakeLabNullColorValuesTest() { PdfDictionary dictionary = new PdfDictionary(); dictionary.Put(PdfName.Gamma, new PdfNumber(2.2)); PdfArray calLab = new PdfArray(); calLab.Add(PdfName.Lab); calLab.Add(dictionary); PdfColorSpace colorSpace = PdfColorSpace.MakeColorSpace(calLab); Color color = Color.MakeColor(colorSpace); NUnit.Framework.Assert.IsTrue(color is Lab); NUnit.Framework.Assert.AreEqual(new float[] { 0.0f, 0.0f, 0.0f }, color.GetColorValue()); }
public virtual void MakeCalRgbTest() { PdfDictionary dictionary = new PdfDictionary(); dictionary.Put(PdfName.Gamma, new PdfNumber(2.2)); PdfArray calRgb = new PdfArray(); calRgb.Add(PdfName.CalRGB); calRgb.Add(dictionary); PdfColorSpace colorSpace = PdfColorSpace.MakeColorSpace(calRgb); float[] colorValues = new float[] { 0.7f, 0.5f, 0.1f }; Color color = Color.MakeColor(colorSpace, colorValues); NUnit.Framework.Assert.IsTrue(color is CalRgb); NUnit.Framework.Assert.AreEqual(colorValues, color.GetColorValue()); }