From 925071ab46f6a1db2be7aa179d05514e478b2e4d Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 5 Feb 2025 11:32:52 +0100 Subject: [PATCH] Use the `getPdfColorArray` helper more in the `src/core/annotation.js` file While the file-size reduction is obviously tiny, it should never hurt to remove code duplication. --- src/core/annotation.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/annotation.js b/src/core/annotation.js index f92dddb82..33cfcaf71 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -4477,10 +4477,7 @@ class InkAnnotation extends MarkupAnnotation { bs.set("W", thickness); // Color. - ink.set( - "C", - Array.from(color, c => c / 255) - ); + ink.set("C", getPdfColorArray(color)); // Opacity. ink.set("CA", opacity); @@ -4694,10 +4691,7 @@ class HighlightAnnotation extends MarkupAnnotation { highlight.set("QuadPoints", quadPoints); // Color. - highlight.set( - "C", - Array.from(color, c => c / 255) - ); + highlight.set("C", getPdfColorArray(color)); // Opacity. highlight.set("CA", opacity);