setFillColor method Null safety

void setFillColor(
  1. PdfColor? color
)

Sets the fill color for drawing

Implementation

void setFillColor(PdfColor? color) {
  if (color is PdfColorCmyk) {
    PdfNumList(<double>[color.cyan, color.magenta, color.yellow, color.black])
        .output(_buf);
    _buf.putString(' k\n');
  } else {
    PdfNumList(<double>[color!.red, color.green, color.blue]).output(_buf);
    _buf.putString(' rg\n');
  }
}