MMpy.Colour
Syntax
MMpy.Colour(R=0, G=0, B=0, null=False)
Description
Creates a new colour object instance.
Parameters
Name |
Type |
Description |
---|---|---|
R |
int (optional) | Red value (0-255), defaults to 0 if not given. |
G | int (optional) | Green value (0-255), defaults to 0 if not given. |
B | int (optional) | Blue value (0-255), defaults to 0 if not given. |
null | bool (optional) | Setting to True creates a null colour, which is interpreted differently depending on the function using it (see notes). |
Returns
Type |
Description |
---|---|
MMpy.Colour | A new colour object instance. |
Notes
The null colour will be interpreted differently by different parts of the application. For example, using the null colour within a chart will usually cause the series to be given an unspecified default colour.
Specifying null=True and setting any of the colour components to a value other than 0 will cause a RuntimeError to be raised.
Examples
colour1 = MMpy.Colour() # Black (0, 0, 0) colour2 = MMpy.Colour(G=255) # Green (0, 255, 0) colour3 = MMpy.Colour(255, 0, 164) # Pink (255, 0, 164) colour4 = MMpy.Colour(null=True) # Null colour
Resource ID
IDPH_COLOUR_CSTR