PdfColor.fromCMYK constructor
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 = await document.save();
//Dispose the document.
document.dispose();
Implementation
PdfColor.fromCMYK(double cyan, double magenta, double yellow, double black) {
_helper = PdfColorHelper(this);
_red = 0;
_cyan = cyan;
_green = 0;
_magenta = magenta;
_blue = 0;
_yellow = yellow;
_black = black;
_gray = 0;
_helper.alpha = _maxColourChannelValue.toInt();
_helper.isFilled = true;
_assignRGB(cyan, magenta, yellow, black);
}