@chialab/pdfjs-lib 1.0.0-alpha.19 → 1.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{NodeCanvasFactory-OREYUFNU.js → NodeCanvasFactory-ONRE5YYL.js} +1 -1
- package/dist/browser/{chunk-MXRUYXDD.js → chunk-ELOUEWKT.js} +16 -1
- package/dist/browser/index.js +780 -479
- package/dist/index.d.ts +2 -0
- package/dist/lib/AnnotationData.d.ts +1 -1
- package/dist/lib/CanvasGraphics.d.ts +1 -0
- package/dist/lib/Path2D.d.ts +1 -1
- package/dist/lib/Svg.d.ts +143 -0
- package/dist/lib/SvgCanvasContext.d.ts +11 -18
- package/dist/lib/TextLayer.d.ts +12 -5
- package/dist/lib/utils.d.ts +6 -0
- package/dist/node/{NodeCanvasFactory-N32SOXPQ.js → NodeCanvasFactory-YRBSQ5MH.js} +1 -1
- package/dist/node/{chunk-QCIN557M.js → chunk-3XZOTLLE.js} +15 -0
- package/dist/node/index.js +780 -479
- package/package.json +1 -1
|
@@ -717,6 +717,20 @@ function rgbToHex(r, g, b) {
|
|
|
717
717
|
}
|
|
718
718
|
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
719
719
|
}
|
|
720
|
+
function parseRgbaColor(color) {
|
|
721
|
+
const match = color.match(
|
|
722
|
+
/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)$/
|
|
723
|
+
);
|
|
724
|
+
if (!match) {
|
|
725
|
+
return { r: 0, g: 0, b: 0, a: 1 };
|
|
726
|
+
}
|
|
727
|
+
return {
|
|
728
|
+
r: Number.parseInt(match[1], 10),
|
|
729
|
+
g: Number.parseInt(match[2], 10),
|
|
730
|
+
b: Number.parseInt(match[3], 10),
|
|
731
|
+
a: match[4] ? Number.parseFloat(match[4]) : 1
|
|
732
|
+
};
|
|
733
|
+
}
|
|
720
734
|
|
|
721
735
|
// src/pdf.js/src/display/filter_factory.js
|
|
722
736
|
var BaseFilterFactory = class {
|
|
@@ -1123,5 +1137,6 @@ export {
|
|
|
1123
1137
|
toDataUrl,
|
|
1124
1138
|
makeSerializable,
|
|
1125
1139
|
colorToRgb,
|
|
1126
|
-
rgbToHex
|
|
1140
|
+
rgbToHex,
|
|
1141
|
+
parseRgbaColor
|
|
1127
1142
|
};
|