ColorCode

class ColorCode(value)[source]

Color definitions from legacy glotaran.

See: https://glotaran.github.io/legacy/plot_styles

Attributes Summary

black

red

blue

green

magenta

cyan

yellow

green4

orange

brown

grey

violet

turquoise

maroon

indigo

Methods Summary

hex_to_rgb

Convert hex code to rgb or rgba tuple.

rgb_to_hex

Convert rgb value tuple to hex code.

Methods Documentation

static hex_to_rgb(hex_string: str) tuple[int, ...][source]

Convert hex code to rgb or rgba tuple.

Parameters:

hex_string (str) – Hey code representation of a color.

Returns:

rgb or rgba tuple representing the same color as hex_string..

Return type:

tuple[int, …]

static rgb_to_hex(rgb_tuple: tuple[float, ...]) str[source]

Convert rgb value tuple to hex code.

Parameters:

rgb_tuple (tuple[float, ...]) – Tuple rgb or rgba values

Returns:

Hex code representing the same color as rgb_tuple.

Return type:

str