Skip to content

Commit

Permalink
Correct type annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
knutnergaard committed Feb 27, 2025
1 parent 5554c0e commit 4c1b43e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Lib/fontParts/base/guideline.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,18 +535,21 @@ def _set_name(self, value: Optional[str]) -> None:
""",
)

def _get_base_color(self) -> Color:
def _get_base_color(self) -> Optional[Color]:
value = self._get_color()
if value is not None:
value = Color(value)
return value

def _set_base_color(self, value: QuadrupleCollectionType[IntFloatType]) -> None:
def _set_base_color(
self,
value: Optional[QuadrupleCollectionType[IntFloatType]]
) -> None:
if value is not None:
value = normalizers.normalizeColor(value)
self._set_color(value)

def _get_color(self) -> QuadrupleCollectionType[IntFloatType]:
def _get_color(self) -> Optional[QuadrupleCollectionType[IntFloatType]]:
"""Get the native guideline's color.
This is the environment implementation of the :attr:`BaseGuideline.color`
Expand All @@ -565,7 +568,7 @@ def _get_color(self) -> QuadrupleCollectionType[IntFloatType]:
"""
self.raiseNotImplementedError()

def _set_color(self, value: QuadrupleType[float]) -> None:
def _set_color(self, value: Optional[QuadrupleType[float]]) -> None:
"""Set the native guideline's color.
This is the environment implementation of the :attr:`BaseGuideline.color`
Expand Down

0 comments on commit 4c1b43e

Please sign in to comment.