PdfColor.fromCMYK constructor Null safety

PdfColor.fromCMYK(
  1. double cyan,
  2. double magenta,
  3. double yellow,
  4. double black
)

Initializes a new instance of the PdfColor class with Cyan, Magenta, Yellow and Black channels.

//Creates a new PDF document.
PdfDocument document = PdfDocument()
  ..pages.add().graphics.drawString(
      'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
      //Using PDF color set pen.
      pen: PdfPen(PdfColor.fromCMYK(200, 120, 80, 40)));
//Saves the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();

Implementation

PdfColor.fromCMYK(double cyan, double magenta, double yellow, double black) {
  _red = 0;
  _cyan = cyan;
  _green = 0;
  _magenta = magenta;
  _blue = 0;
  _yellow = yellow;
  _black = black;
  _gray = 0;
  _alpha = _maxColourChannelValue.toInt();
  _isFilled = true;
  _assignRGB(cyan, magenta, yellow, black);
}