idk, first attempt at adding docs ig. Probably gonna break so yea...

This commit is contained in:
iDutchy
2020-12-01 02:25:51 -06:00
parent 6e024871ec
commit 9f54345f5c
4 changed files with 38 additions and 18 deletions

View File

@@ -121,7 +121,9 @@ class Colour:
@classmethod
def random(cls):
"""A factory method that returns a :class:`Colour` with a random value."""
"""A factory method that returns a :class:`Colour` with a random value.
.. versionadded:: 1.6"""
return cls(random.randint(0x000000,0xffffff))
@classmethod
@@ -129,19 +131,6 @@ class Colour:
"""A factory method that returns a :class:`Colour` with a value of ``0``."""
return cls(0)
@classmethod
def random(cls):
"""A factory method that returns a :class:`Colour` with a random hue.
.. note::
The random algorithm works by choosing a colour with a random hue but
with maxed out saturation and value.
.. versionadded:: 1.6
"""
return cls.from_hsv(random.random(), 1, 1)
@classmethod
def teal(cls):
"""A factory method that returns a :class:`Colour` with a value of ``0x1abc9c``."""