Skip to content

Commit

Permalink
update default color return and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mtd91429 committed Jul 8, 2022
1 parent 5539deb commit ba43f9d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion PyPDF2/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,10 +1703,16 @@ def additionalActions(self) -> Optional[DictionaryObject]: # pragma: no cover
deprecate_with_replacement("additionalActions", "additional_actions")
return self.additional_actions


class OutlineItemFlag(IntFlag):
"""
A class used as an enumerable flag for formatting outline font
"""

italic = 1
bold = 2


class Destination(TreeObject):
"""
A class representing a destination within a PDF file.
Expand Down Expand Up @@ -1857,7 +1863,7 @@ def bottom(self) -> Optional[FloatObject]:
@property
def color(self) -> Optional[tuple]:
"""Read-only property accessing the color in (R, G, B) with values 0.0-1.0"""
return self.get("/C", None)
return self.get("/C", (0.0, 0.0, 0.0))

@property
def fmt(self) -> Optional[OutlineItemFlag]:
Expand Down

0 comments on commit ba43f9d

Please sign in to comment.