|
@ -97,6 +97,11 @@ class Colour: |
|
|
"""Returns an (r, g, b) tuple representing the colour.""" |
|
|
"""Returns an (r, g, b) tuple representing the colour.""" |
|
|
return (self.r, self.g, self.b) |
|
|
return (self.r, self.g, self.b) |
|
|
|
|
|
|
|
|
|
|
|
@classmethod |
|
|
|
|
|
def from_rgb(cls, r, g, b): |
|
|
|
|
|
"""Constructs a :class:`Colour` from an RGB tuple.""" |
|
|
|
|
|
return cls((r << 16) + (g << 8) + b) |
|
|
|
|
|
|
|
|
@classmethod |
|
|
@classmethod |
|
|
def default(cls): |
|
|
def default(cls): |
|
|
"""A factory method that returns a :class:`Colour` with a value of 0.""" |
|
|
"""A factory method that returns a :class:`Colour` with a value of 0.""" |
|
|