add hex() support to Color
This commit is contained in:
1 parent
b2540ee312
commit
d28f0ff35b
1 file changed
+3
@@ -85,6 +85,9 @@ class Colour:
|
|||||||
def __int__(self):
|
def __int__(self):
|
||||||
return int(str(self.value), 16)
|
return int(str(self.value), 16)
|
||||||
|
|
||||||
|
def __hex__(self):
|
||||||
|
return self.value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def r(self):
|
def r(self):
|
||||||
""":class:`int`: Returns the red component of the colour."""
|
""":class:`int`: Returns the red component of the colour."""
|
||||||
|
|||||||
Reference in new issue
Block a user