IDS peak ICV v1.6.0
Loading...
Searching...
No Matches
Color Class Reference
Inheritance diagram for Color:

Public Member Functions

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)
 

Protected Attributes

int _color_code = kwargs["_color_code"]
 

Detailed Description

Class holding color codes.

Since
ids_peak_icv 1.0

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self,
*Any args,
**Any kwargs )

In order to create a color, please refer to the class methods.

Exceptions
NotPossibleExceptionIf the class cannot be initialized by default init.
Since
ids_peak_icv 1.0

Reimplemented in ColorPalette.

Member Function Documentation

◆ __eq__()

bool __eq__ ( self,
object other )

Check if two Color objects are equal.

Parameters
other(Color): Another Color object.
Returns
True if equal, False otherwise.
Since
ids_peak_icv 1.0

◆ __ne__()

bool __ne__ ( self,
object other )

Check if two Color objects are not equal.

Parameters
other(Color): Another Color object.
Returns
True if not equal, False otherwise.
Since
ids_peak_icv 1.0

◆ __str__()

str __str__ ( self)
Returns
String representation of the object.
Since
ids_peak_icv 1.0

◆ color_code()

int color_code ( self)

Get the color code.

Returns
The color as an integer.
Since
ids_peak_icv 1.0

Reimplemented in ColorPalette.

◆ create_from_constant()

Color create_from_constant ( cls,
ColorConstant color_constant,
int num_bits_per_pixel )

Creates a color from a color constant value.

Parameters
color_constantA ColorConstant.
num_bits_per_pixelNumber of bits per pixel.
Exceptions
NotSupportedExceptionIf the color constant is unknown.
Returns
A Color object.
Since
ids_peak_icv 1.0

◆ 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
redRed value.
greenGreen value.
blueBlue value.
num_bits_per_pixelNumber of bits per pixel. Defaults to 8.
Exceptions
OutOfRangeExceptionIf the color values are out of range.
Returns
A Color object.
Since
ids_peak_icv 1.0

◆ 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.

Field Documentation

◆ _color_code

int _color_code = kwargs["_color_code"]
protected