From 4c1b43eef1f4eb1d771afc8c029f8743c3aed3f1 Mon Sep 17 00:00:00 2001 From: knutnergaard Date: Thu, 27 Feb 2025 07:06:28 +0100 Subject: [PATCH] Correct type annotations. --- Lib/fontParts/base/guideline.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Lib/fontParts/base/guideline.py b/Lib/fontParts/base/guideline.py index 9c0b3988..c30e6bfa 100644 --- a/Lib/fontParts/base/guideline.py +++ b/Lib/fontParts/base/guideline.py @@ -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` @@ -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`