mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 02:54:52 +00:00
api/parameters: Color divide value
This is the inverse of scaling by a constant through multiplication.
This commit is contained in:
@@ -52,6 +52,12 @@ class Color:
|
||||
def __rmul__(self, scale):
|
||||
return self.__mul__(scale)
|
||||
|
||||
def __truediv__(self, scale):
|
||||
return self.__mul__(1/scale)
|
||||
|
||||
def __floordiv__(self, scale):
|
||||
return self.__mul__(1/scale)
|
||||
|
||||
|
||||
Color.BLACK = Color(0, 0, 0, 'BLACK')
|
||||
Color.GRAY = Color(0, 0, 50, 'GRAY')
|
||||
|
||||
Reference in New Issue
Block a user