|
| Color | create_from_rgb (cls, int red, int green, int blue, int num_bits_per_pixel=8) |
| | Creates a color from red, green and blue values.
|
| |
| Color | create_from_constant (cls, ColorConstant color_constant, int num_bits_per_pixel) |
| | Creates a color from a color constant value.
|
| |
| None | __init__ (self, *Any args, **Any kwargs) |
| | In order to create a color, please refer to the class methods.
|
| |
| tuple[int, int, int] | rgb (self) |
| | The color as a tuple of red, green and blue values.
|
| |
| int | color_code (self) |
| | Get the color code.
|
| |
| bool | __eq__ (self, object other) |
| | Check if two Color objects are equal.
|
| |
| bool | __ne__ (self, object other) |
| | Check if two Color objects are not equal.
|
| |
| str | __str__ (self) |
| |
Class holding color codes.
- Since
- ids_peak_icv 1.0
Definition at line 82 of file color.py.
◆ __init__()
| None __init__ |
( |
| self, |
|
|
*Any | args, |
|
|
**Any | kwargs ) |
In order to create a color, please refer to the class methods.
- Exceptions
-
| NotPossibleException | If the class cannot be initialized by default init. |
- Since
- ids_peak_icv 1.0
Reimplemented in ColorPalette.
Definition at line 213 of file color.py.
◆ __eq__()
| bool __eq__ |
( |
| self, |
|
|
object | other ) |
Check if two Color objects are equal.
- Parameters
-
- Returns
- True if equal, False otherwise.
- Since
- ids_peak_icv 1.0
Definition at line 288 of file color.py.
◆ __ne__()
| bool __ne__ |
( |
| self, |
|
|
object | other ) |
Check if two Color objects are not equal.
- Parameters
-
- Returns
- True if not equal, False otherwise.
- Since
- ids_peak_icv 1.0
Definition at line 305 of file color.py.
◆ __str__()
◆ color_code()
◆ create_from_constant()
Creates a color from a color constant value.
- Parameters
-
| color_constant | A ColorConstant. |
| num_bits_per_pixel | Number of bits per pixel. |
- Exceptions
-
| NotSupportedException | If the color constant is unknown. |
- Returns
- A Color object.
- Since
- ids_peak_icv 1.0
Definition at line 123 of file color.py.
◆ create_from_rgb()
| Color create_from_rgb |
( |
| cls, |
|
|
int | red, |
|
|
int | green, |
|
|
int | blue, |
|
|
int | num_bits_per_pixel = 8 ) |
Creates a color from red, green and blue values.
The values must be between 0 and 255 and will be automatically adapted to the given bit range.
- Parameters
-
| red | Red value. |
| green | Green value. |
| blue | Blue value. |
| num_bits_per_pixel | Number of bits per pixel. Defaults to 8. |
- Exceptions
-
| OutOfRangeException | If the color values are out of range. |
- Returns
- A Color object.
- Since
- ids_peak_icv 1.0
Definition at line 92 of file color.py.
◆ rgb()
| tuple[int, int, int] rgb |
( |
| self | ) |
|
The color as a tuple of red, green and blue values.
- Returns
- Tuple with format (r, g, b)
- Since
- ids_peak_icv 1.0
Reimplemented in ColorPalette.
Definition at line 265 of file color.py.
◆ _color_code
| int _color_code = kwargs["_color_code"] |
|
protected |