weldx.visualization.colors.get_color#

weldx.visualization.colors.get_color(key, color_dict, color_generator)#

Get a 24 bit RGB color from a dictionary or generator function.

If the provided key is found in the dictionary, the corresponding color is returned. Otherwise, the generator is used to provide a color.

Parameters
  • key (str) – The key that should be searched for in the dictionary

  • color_dict (dict[str, Union[int, tuple[int, int, int]]]) – A dictionary containing name to color mappings

  • color_generator (Generator) – A generator that returns a color integer

Returns

RGB color as 24 bit integer

Return type

int