gray property

PdfBrush get gray

Gets the Gray default brush.

//Create a new PDF document.
PdfDocument doc = PdfDocument();
//Draw rectangle.
doc.pages.add().graphics.drawRectangle(
    brush: PdfBrushes.gray, bounds: Rect.fromLTWH(0, 0, 200, 100));
//Save the document.
List<int> bytes = doc.save();
//Dispose the document.
doc.dispose();

Implementation

static PdfBrush get gray {
  if (_brushes.containsKey(KnownColor.gray)) {
    return _brushes[KnownColor.gray]!;
  } else {
    return _getBrush(KnownColor.gray);
  }
}