Class PdfLabColor
Represents a calibrated Lab color, based on a Lab colorspace.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.ColorSpace
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfLabColor : PdfExtendedColor
Examples
// Creates a new document
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
// Create lab color space
PdfLabColorSpace calGrayCS = new PdfLabColorSpace();
calGrayCS.Range = new double[] { 0.2, 1, 0.8, 23.5 };
calGrayCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
// Create lab color
PdfLabColor labColor = new PdfLabColor(calGrayCS);
labColor.L = 90;
labColor.A = 0.5;
labColor.B = 20;
PdfPen pen = new PdfPen(labColor);
RectangleF rect = new RectangleF(20, 70, 200, 100);
page.Graphics.DrawRectangle(pen, rect);
doc.Save("LabColor.pdf");
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Creates lab color space
Dim calGrayCS As PdfLabColorSpace = New PdfLabColorSpace()
calGrayCS.Range = New Double() { 0.2, 1, 0.8, 23.5 }
calGrayCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
' Create lab color
Dim labColor As PdfLabColor = New PdfLabColor(calGrayCS)
labColor.L = 90
labColor.A = 0.5
labColor.B = 20
Dim pen As PdfPen = New PdfPen(labColor)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
page.Graphics.DrawRectangle(pen, rect)
doc.Save("LabColor.pdf")
Constructors
PdfLabColor(PdfColorSpaces)
Initializes a new instance of the PdfLabColor class.
Declaration
public PdfLabColor(PdfColorSpaces colorspace)
Parameters
Type | Name | Description |
---|---|---|
PdfColorSpaces | colorspace | The ColorSpace. |
Examples
// Creates a new document
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
// Create lab color space
PdfLabColorSpace calGrayCS = new PdfLabColorSpace();
calGrayCS.Range = new double[] { 0.2, 1, 0.8, 23.5 };
calGrayCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
// Create lab color
PdfLabColor labColor = new PdfLabColor(calGrayCS);
labColor.L = 90;
labColor.A = 0.5;
labColor.B = 20;
PdfPen pen = new PdfPen(labColor);
RectangleF rect = new RectangleF(20, 70, 200, 100);
page.Graphics.DrawRectangle(pen, rect);
doc.Save("LabColor.pdf");
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Creates lab color space
Dim calGrayCS As PdfLabColorSpace = New PdfLabColorSpace()
calGrayCS.Range = New Double() { 0.2, 1, 0.8, 23.5 }
calGrayCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
' Create lab color
Dim labColor As PdfLabColor = New PdfLabColor(calGrayCS)
labColor.L = 90
labColor.A = 0.5
labColor.B = 20
Dim pen As PdfPen = New PdfPen(labColor)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
page.Graphics.DrawRectangle(pen, rect)
doc.Save("LabColor.pdf")
See Also
Properties
A
Gets or sets the a* component for this color.
Declaration
public double A { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The a* component of this color. |
Remarks
The range for this value is defined by the Range property of the underlying Lab colorspace.
Examples
// Creates a new document
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
// Create lab color space
PdfLabColorSpace calGrayCS = new PdfLabColorSpace();
calGrayCS.Range = new double[] { 0.2, 1, 0.8, 23.5 };
calGrayCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
// Create lab color
PdfLabColor labColor = new PdfLabColor(calGrayCS);
labColor.L = 90;
labColor.A = 0.5;
labColor.B = 20;
PdfPen pen = new PdfPen(labColor);
RectangleF rect = new RectangleF(20, 70, 200, 100);
page.Graphics.DrawRectangle(pen, rect);
doc.Save("LabColor.pdf");
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Creates lab color space
Dim calGrayCS As PdfLabColorSpace = New PdfLabColorSpace()
calGrayCS.Range = New Double() { 0.2, 1, 0.8, 23.5 }
calGrayCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
' Create lab color
Dim labColor As PdfLabColor = New PdfLabColor(calGrayCS)
labColor.L = 90
labColor.A = 0.5
labColor.B = 20
Dim pen As PdfPen = New PdfPen(labColor)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
page.Graphics.DrawRectangle(pen, rect)
doc.Save("LabColor.pdf")
See Also
B
Gets or sets the b* component for this color.
Declaration
public double B { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The b* component of this color. |
Remarks
The range for this value is defined by the Range property of the underlying Lab colorspace.
Examples
// Creates a new document
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
// Create lab color space
PdfLabColorSpace calGrayCS = new PdfLabColorSpace();
calGrayCS.Range = new double[] { 0.2, 1, 0.8, 23.5 };
calGrayCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
// Create lab color
PdfLabColor labColor = new PdfLabColor(calGrayCS);
labColor.L = 90;
labColor.A = 0.5;
labColor.B = 20;
PdfPen pen = new PdfPen(labColor);
RectangleF rect = new RectangleF(20, 70, 200, 100);
page.Graphics.DrawRectangle(pen, rect);
doc.Save("LabColor.pdf");
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Creates lab color space
Dim calGrayCS As PdfLabColorSpace = New PdfLabColorSpace()
calGrayCS.Range = New Double() { 0.2, 1, 0.8, 23.5 }
calGrayCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
' Create lab color
Dim labColor As PdfLabColor = New PdfLabColor(calGrayCS)
labColor.L = 90
labColor.A = 0.5
labColor.B = 20
Dim pen As PdfPen = New PdfPen(labColor)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
page.Graphics.DrawRectangle(pen, rect)
doc.Save("LabColor.pdf")
See Also
L
Gets or sets the l component for this color.
Declaration
public double L { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The l component of this color. |
Remarks
The acceptable range for this value is [0.0 100.0]. 0.0 means the darkest color that can be achieved, and 100.0 means the lightest color.
Examples
// Creates a new document
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
// Create lab color space
PdfLabColorSpace calGrayCS = new PdfLabColorSpace();
calGrayCS.Range = new double[] { 0.2, 1, 0.8, 23.5 };
calGrayCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
// Create lab color
PdfLabColor labColor = new PdfLabColor(calGrayCS);
labColor.L = 90;
labColor.A = 0.5;
labColor.B = 20;
PdfPen pen = new PdfPen(labColor);
RectangleF rect = new RectangleF(20, 70, 200, 100);
page.Graphics.DrawRectangle(pen, rect);
doc.Save("LabColor.pdf");
' Create a new document
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Creates lab color space
Dim calGrayCS As PdfLabColorSpace = New PdfLabColorSpace()
calGrayCS.Range = New Double() { 0.2, 1, 0.8, 23.5 }
calGrayCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
' Create lab color
Dim labColor As PdfLabColor = New PdfLabColor(calGrayCS)
labColor.L = 90
labColor.A = 0.5
labColor.B = 20
Dim pen As PdfPen = New PdfPen(labColor)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
page.Graphics.DrawRectangle(pen, rect)
doc.Save("LabColor.pdf")