Skip to content

Commit

Permalink
silence some warnings about invalid colours in test files
Browse files Browse the repository at this point in the history
  • Loading branch information
0xabu committed Dec 30, 2024
1 parent 600fb6d commit b52a46a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdfannots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def _mkannotation(
contents = cleanup_text(pdfminer.utils.decode_text(contents))

rgb: typ.Optional[RGB] = None
color = pa.get('C')
if color is not None:
color = pdftypes.resolve1(pa.get('C'))
if color:
if (isinstance(color, list)
and len(color) == 3
and all(isinstance(e, (int, float)) and 0 <= e <= 1 for e in color)):
Expand Down

0 comments on commit b52a46a

Please sign in to comment.