prolint.plotting.theme

ProLint theme and color utilities.

This module provides color schemes, gradients, and styling functions for consistent visualization across ProLint plots.

Attributes

Functions

hex_to_rgb(→ Tuple[int, int, int])

Convert hex color string to RGB tuple.

interpolate_gradient(→ Tuple[float, float, float, float])

Interpolate a color from a gradient based on value.

get_color_for_value(→ str)

Get a hex color for a value from a discrete color scale.

get_unit_label(→ str)

Get display label for a time unit.

get_colormap([name])

Get a matplotlib colormap by name.

interpolate_color(→ Tuple[float, float, float, float])

Interpolate a color from a gradient based on value.

apply_prolint_style()

Apply ProLint plotting style to matplotlib.

Module Contents

prolint.plotting.theme.COLORS: Dict[source]
prolint.plotting.theme.COLOR_SCALES: Dict[str, List[str]][source]
prolint.plotting.theme.GRADIENTS: Dict[source]
prolint.plotting.theme.AMINO_ACID_COLORS: Dict[str, str][source]
prolint.plotting.theme.AMINO_ACID_ONE_LETTER: Dict[str, str][source]
prolint.plotting.theme.UNIT_LABELS: Dict[str, str][source]
prolint.plotting.theme.hex_to_rgb(hex_color: str) Tuple[int, int, int][source]

Convert hex color string to RGB tuple.

Parameters:

hex_color (str) – Hex color string (e.g., “#FF5733” or “FF5733”).

Returns:

RGB values as (red, green, blue), each 0-255.

Return type:

tuple of int

prolint.plotting.theme.interpolate_gradient(value: float, min_val: float, max_val: float, gradient_name: str = 'sharedContacts') Tuple[float, float, float, float][source]

Interpolate a color from a gradient based on value.

Parameters:
  • value (float) – Value to map to a color.

  • min_val (float) – Minimum value of the range.

  • max_val (float) – Maximum value of the range.

  • gradient_name (str, default="sharedContacts") – Name of the gradient to use from GRADIENTS.

Returns:

Interpolated RGBA color values (0-1 range).

Return type:

tuple of float

prolint.plotting.theme.get_color_for_value(value: float, scale_name: str = 'prolint', vmin: float = 0, vmax: float = 1) str[source]

Get a hex color for a value from a discrete color scale.

Parameters:
  • value (float) – Value to map to a color.

  • scale_name (str, default="prolint") – Name of the color scale from COLOR_SCALES.

  • vmin (float, default=0) – Minimum value of the range.

  • vmax (float, default=1) – Maximum value of the range.

Returns:

Hex color string.

Return type:

str

prolint.plotting.theme.get_unit_label(unit: str) str[source]

Get display label for a time unit.

Parameters:

unit (str) – Time unit code (e.g., “us”, “ns”, “ps”).

Returns:

Human-readable unit label (e.g., “μs”, “ns”, “ps”).

Return type:

str

prolint.plotting.theme.get_colormap(name: str = 'viridis')[source]

Get a matplotlib colormap by name.

Parameters:

name (str, default="viridis") – Color scale name from COLOR_SCALES.

Returns:

Matplotlib colormap object.

Return type:

LinearSegmentedColormap

Raises:

ValueError – If name is not a valid color scale.

prolint.plotting.theme.interpolate_color(value: float, min_val: float, max_val: float, gradient_name: str = 'sharedContacts') Tuple[float, float, float, float][source]

Interpolate a color from a gradient based on value.

Parameters:
  • value (float) – Value to interpolate.

  • min_val (float) – Minimum value in range.

  • max_val (float) – Maximum value in range.

  • gradient_name (str, default="sharedContacts") – Gradient name from GRADIENTS.

Returns:

RGBA color tuple with values in 0-1 range.

Return type:

tuple of (float, float, float, float)

prolint.plotting.theme.PLOT_STYLE[source]
prolint.plotting.theme.apply_prolint_style()[source]

Apply ProLint plotting style to matplotlib.

Updates matplotlib rcParams with ProLint theme colors and fonts. Called automatically by plotter classes.