IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
ColorPalette Class Reference
Inheritance diagram for ColorPalette:

Public Member Functions

ColorPalette create_from_colors (cls, *Color args)
 Create a pallet from a number of Colors.
 
ColorPalette create_from_palette_constant (cls, ColorPaletteConstant color_palette_constant, int num_bits_per_pixel=8)
 Create a pallet with a specific number of colors.
 
None __init__ (self, *Any args, **Any kwargs)
 In order to create a color palette, please refer to the class methods.
 
tuple[int, int, int] rgb (self)
 Get the next color of the palette as a tuple with the red, green and blue values.
 
int color_code (self)
 Get the next color of the palette as an integer.
 

Protected Attributes

 _colorPalette = kwargs["_color_palette"]
 
int _colorPaletteIndex = 0
 
 _color_code = self._colorPalette[self._colorPaletteIndex]._color_code
 

Detailed Description

Class holding a color palette (a set of colors).

Since
ids_peak_icv 1.0

Definition at line 328 of file color.py.

Constructor & Destructor Documentation

◆ __init__()

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

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

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

Reimplemented from Color.

Definition at line 373 of file color.py.

Member Function Documentation

◆ color_code()

int color_code ( self)

Get the next color of the palette as an integer.

Returns
The color as an integer.
Since
ids_peak_icv 1.0

Reimplemented from Color.

Definition at line 407 of file color.py.

◆ create_from_colors()

ColorPalette create_from_colors ( cls,
*Color args )

Create a pallet from a number of Colors.

Parameters
argsComma separated Colors.
Returns
A ColorPalette object.
Since
ids_peak_icv 1.0

Definition at line 339 of file color.py.

◆ create_from_palette_constant()

ColorPalette create_from_palette_constant ( cls,
ColorPaletteConstant color_palette_constant,
int num_bits_per_pixel = 8 )

Create a pallet with a specific number of colors.

The colors in the palett are

  • RED, GREEN, BLUE (for COLORED_3)
  • RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN (for COLORED_6)
Parameters
color_palette_constantA ColorPaletteConstant.
num_bits_per_pixelNumber of bits per pixel. Defaults to 8.
Returns
A ColorPalette object.
Since
ids_peak_icv 1.0

Definition at line 352 of file color.py.

◆ rgb()

tuple[int, int, int] rgb ( self)

Get the next color of the palette as a tuple with the red, green and blue values.

Returns
Tuple with format (r, g, b).
Since
ids_peak_icv 1.0

Reimplemented from Color.

Definition at line 393 of file color.py.

Field Documentation

◆ _color_code

_color_code = self._colorPalette[self._colorPaletteIndex]._color_code
protected

Definition at line 422 of file color.py.

◆ _colorPalette

_colorPalette = kwargs["_color_palette"]
protected

Definition at line 384 of file color.py.

◆ _colorPaletteIndex

int _colorPaletteIndex = 0
protected

Definition at line 389 of file color.py.