We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba5acda commit 27bd1d1Copy full SHA for 27bd1d1
1 file changed
src/pybricks/parameters.py
@@ -113,10 +113,10 @@ def __init__(self, h: Number, s: Number = 100, v: Number = 100):
113
"""
114
115
def __setattr__(self, key, value):
116
- if not hasattr(self, key):
117
- super().__setattr__(key, value)
118
- else: # immutable after __init__
119
- raise AttributeError("Can't modify immutable object attribute: " + key)
+ if not hasattr(self, key):
+ super().__setattr__(key, value)
+ else: # immutable after __init__
+ raise AttributeError("Can't modify immutable object attribute: " + key)
120
121
def __iter__(self):
122
"""Allows unpacking of the Color instance into h, s, and v."""
@@ -147,6 +147,7 @@ def __lshift__(self, shift: int) -> Color:
147
def __rshift__(self, shift: int) -> Color:
148
return Color((self.h + shift) % 360, self.s, self.v)
149
150
+
151
Color.NONE = Color(0, 0, 0)
152
Color.BLACK = Color(0, 0, 10)
153
Color.GRAY = Color(0, 0, 50)
0 commit comments