@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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BaseCanvasFactory
3
- } from "./chunk-MXRUYXDD.js";
3
+ } from "./chunk-ELOUEWKT.js";
4
4
  import "./chunk-NJUB3B5A.js";
5
5
  import "./chunk-O4UKW7AD.js";
6
6
 
@@ -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
  };