aboutsummaryrefslogtreecommitdiff
path: root/discord/colour.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-12-17 00:30:08 -0500
committerRapptz <[email protected]>2015-12-17 00:32:54 -0500
commit51d91c2a82e01275d1c1d888319f1db14dc11791 (patch)
tree80aeac8f9a7d2c9be21e775c9185bec34cb10756 /discord/colour.py
parentAdd Message.clean_content property to get prettified mentions. (diff)
downloaddiscord.py-51d91c2a82e01275d1c1d888319f1db14dc11791.tar.xz
discord.py-51d91c2a82e01275d1c1d888319f1db14dc11791.zip
Most data classes now support hashing.
Diffstat (limited to 'discord/colour.py')
-rw-r--r--discord/colour.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/colour.py b/discord/colour.py
index 0b63a608..67137cb4 100644
--- a/discord/colour.py
+++ b/discord/colour.py
@@ -39,6 +39,8 @@ class Colour(object):
+-----------+----------------------------------------+
| x != y | Checks if two colours are not equal. |
+-----------+----------------------------------------+
+ | hash(x) | Return the colour's hash. |
+ +-----------+----------------------------------------+
| str(x) | Returns the hex format for the colour. |
+-----------+----------------------------------------+
@@ -63,6 +65,9 @@ class Colour(object):
def __str__(self):
return '#' + format(self.value, 'x')
+ def __hash__(self):
+ return hash(self.value)
+
@property
def r(self):
"""Returns the red component of the colour."""