In the following example we demonstrate how to use generic color
components to draw in the Lab color space.
using var doc = new Doc();
doc.Width = 80;
doc.Rect.Inset(50, 50);
var cs = new ColorSpace(doc.ObjectSoup, ColorSpaceType.Lab);
doc.ColorSpace = cs.ID;
// This Lab color is a deep green
doc.Color.ColorSpace = ColorOperatorType.ColorSpace;
doc.Color.Components[0] = 50; // L range is 0 to +100
doc.Color.Components[1] = -50; // a range is -100 to +100
doc.Color.Components[2] = +50; // B range is -100 to +100
doc.AddOval(true);
doc.Save("examplelabcolorspace.pdf");