public virtual ColorDetails[] GetColorantDetails(PdfWriter writer) { if (altColorDetails == null && this.altcs is ExtendedColor && ((ExtendedColor)this.altcs).Type == ExtendedColor.TYPE_LAB) { altColorDetails = writer.AddSimple(((LabColor)altcs).LabColorSpace); } return(new ColorDetails[] { altColorDetails }); }
virtual protected void SetColorSpace(BaseColor color) { cspace = color; int type = ExtendedColor.GetType(color); PdfObject colorSpace = null; switch (type) { case ExtendedColor.TYPE_GRAY: { colorSpace = PdfName.DEVICEGRAY; break; } case ExtendedColor.TYPE_CMYK: { colorSpace = PdfName.DEVICECMYK; break; } case ExtendedColor.TYPE_SEPARATION: { SpotColor spot = (SpotColor)color; colorDetails = writer.AddSimple(spot.PdfSpotColor); colorSpace = colorDetails.IndirectReference; break; } case ExtendedColor.TYPE_DEVICEN: { DeviceNColor deviceNColor = (DeviceNColor)color; colorDetails = writer.AddSimple(deviceNColor.PdfDeviceNColor); colorSpace = colorDetails.IndirectReference; break; } case ExtendedColor.TYPE_PATTERN: case ExtendedColor.TYPE_SHADING: { ThrowColorSpaceError(); break; } default: colorSpace = PdfName.DEVICERGB; break; } shading.Put(PdfName.COLORSPACE, colorSpace); }
public virtual ColorDetails[] GetColorantDetails(PdfWriter writer) { if (colorantsDetails == null) { colorantsDetails = new ColorDetails[spotColors.Length]; int i = 0; foreach (PdfSpotColor spotColorant in spotColors) { colorantsDetails[i] = writer.AddSimple(spotColorant); i++; } } return(colorantsDetails); }
protected void SetColorSpace(BaseColor color) { ColorSpace = color; int type = ExtendedColor.GetType(color); PdfObject colorSpace = null; switch (type) { case ExtendedColor.TYPE_GRAY: { colorSpace = PdfName.Devicegray; break; } case ExtendedColor.TYPE_CMYK: { colorSpace = PdfName.Devicecmyk; break; } case ExtendedColor.TYPE_SEPARATION: { SpotColor spot = (SpotColor)color; colorDetails = writer.AddSimple(spot.PdfSpotColor); colorSpace = colorDetails.IndirectReference; break; } case ExtendedColor.TYPE_PATTERN: case ExtendedColor.TYPE_SHADING: { ThrowColorSpaceError(); break; } default: colorSpace = PdfName.Devicergb; break; } Shading.Put(PdfName.Colorspace, colorSpace); }