From 386863306e5c3ec4c14dd729e493413868756cba Mon Sep 17 00:00:00 2001 From: Andrew Baumann Date: Sun, 30 Jul 2023 13:44:20 +0200 Subject: [PATCH] fix the fixup --- pdfannots/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdfannots/__init__.py b/pdfannots/__init__.py index 5c0fe29..007cf5d 100644 --- a/pdfannots/__init__.py +++ b/pdfannots/__init__.py @@ -74,9 +74,9 @@ def _mkannotation( rgb: typ.Optional[RGB] = None color = pa.get('C') if color is not None: - if isinstance(color, list) + if (isinstance(color, list) and len(color) == 3 - and all(isinstance(e, float) and 0 <= e <= 1 for e in color): + and all(isinstance(e, float) and 0 <= e <= 1 for e in color)): rgb = RGB(*color) else: logger.warning("Invalid color %s in annotation on %s", color, page)