Add __int__ to discord.Colour
This commit is contained in:
parent
686e531624
commit
f4a861d76e
@ -53,6 +53,10 @@ class Colour:
|
|||||||
.. describe:: str(x)
|
.. describe:: str(x)
|
||||||
|
|
||||||
Returns the hex format for the colour.
|
Returns the hex format for the colour.
|
||||||
|
|
||||||
|
.. describe:: int(x)
|
||||||
|
|
||||||
|
Returns the raw color value.
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
------------
|
------------
|
||||||
@ -79,6 +83,9 @@ class Colour:
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'#{self.value:0>6x}'
|
return f'#{self.value:0>6x}'
|
||||||
|
|
||||||
|
def __int__(self):
|
||||||
|
return self.value
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f'<Colour value={self.value}>'
|
return f'<Colour value={self.value}>'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user