color property

PdfColor get color

Gets or sets the color of the pen.

//Create a new PDF document.
PdfDocument document = PdfDocument()
  ..pages.add().graphics.drawRectangle(
      pen: PdfPen(PdfColor(255, 0, 0)),
      bounds: Rect.fromLTWH(10, 10, 200, 100));
//Save the document.
List<int> bytes = await document.save();
//Close the document.
document.dispose();

Implementation

PdfColor get color => _color;
set color (PdfColor value)

Implementation

set color(PdfColor value) {
  _checkImmutability();
  _color = value;
}