Colour¶
discord_http.colour module¶
- class discord_http.colour.Colour(value: int)[source]¶
Bases:
object
- property b: int¶
Returns the blue component of the colour
- Type:
int
- classmethod from_hex(hex: str) Self [source]¶
Creates a Colour object from a hex string
- Parameters:
hex (str) – The hex string to convert
- Returns:
The colour object
- Return type:
Colour
- Raises:
ValueError – Invalid hex colour
- classmethod from_rgb(r: int, g: int, b: int) Self [source]¶
Creates a Colour object from RGB values
- Parameters:
r (int) – Red value
g (int) – Green value
b (int) – Blue value
- Returns:
The colour object
- Return type:
Colour
- property g: int¶
Returns the green component of the colour
- Type:
int
- property r: int¶
Returns the red component of the colour
- Type:
int