pdfkit/lib/spotcolor.js
Luiz Américo Pereira Câmara a76ab284a8 Apply prettier formatting
2025-04-12 12:57:31 -03:00

26 lines
552 B
JavaScript

export default class SpotColor {
constructor(doc, name, C, M, Y, K) {
this.id = 'CS' + Object.keys(doc.spotColors).length;
this.name = name;
this.values = [C, M, Y, K];
this.ref = doc.ref([
'Separation',
this.name,
'DeviceCMYK',
{
Range: [0, 1, 0, 1, 0, 1, 0, 1],
C0: [0, 0, 0, 0],
C1: this.values.map((value) => value / 100),
FunctionType: 2,
Domain: [0, 1],
N: 1,
},
]);
this.ref.end();
}
toString() {
return `${this.ref.id} 0 R`;
}
}