prolint.plotting.theme ====================== .. py:module:: prolint.plotting.theme .. autoapi-nested-parse:: ProLint theme and color utilities. This module provides color schemes, gradients, and styling functions for consistent visualization across ProLint plots. Attributes ---------- .. autoapisummary:: prolint.plotting.theme.COLORS prolint.plotting.theme.COLOR_SCALES prolint.plotting.theme.GRADIENTS prolint.plotting.theme.AMINO_ACID_COLORS prolint.plotting.theme.AMINO_ACID_ONE_LETTER prolint.plotting.theme.UNIT_LABELS prolint.plotting.theme.PLOT_STYLE Functions --------- .. autoapisummary:: prolint.plotting.theme.hex_to_rgb prolint.plotting.theme.interpolate_gradient prolint.plotting.theme.get_color_for_value prolint.plotting.theme.get_unit_label prolint.plotting.theme.get_colormap prolint.plotting.theme.interpolate_color prolint.plotting.theme.apply_prolint_style Module Contents --------------- .. py:data:: COLORS :type: Dict .. py:data:: COLOR_SCALES :type: Dict[str, List[str]] .. py:data:: GRADIENTS :type: Dict .. py:data:: AMINO_ACID_COLORS :type: Dict[str, str] .. py:data:: AMINO_ACID_ONE_LETTER :type: Dict[str, str] .. py:data:: UNIT_LABELS :type: Dict[str, str] .. py:function:: hex_to_rgb(hex_color: str) -> Tuple[int, int, int] Convert hex color string to RGB tuple. :param hex_color: Hex color string (e.g., "#FF5733" or "FF5733"). :type hex_color: str :returns: RGB values as (red, green, blue), each 0-255. :rtype: tuple of int .. py:function:: interpolate_gradient(value: float, min_val: float, max_val: float, gradient_name: str = 'sharedContacts') -> Tuple[float, float, float, float] Interpolate a color from a gradient based on value. :param value: Value to map to a color. :type value: float :param min_val: Minimum value of the range. :type min_val: float :param max_val: Maximum value of the range. :type max_val: float :param gradient_name: Name of the gradient to use from GRADIENTS. :type gradient_name: str, default="sharedContacts" :returns: Interpolated RGBA color values (0-1 range). :rtype: tuple of float .. py:function:: get_color_for_value(value: float, scale_name: str = 'prolint', vmin: float = 0, vmax: float = 1) -> str Get a hex color for a value from a discrete color scale. :param value: Value to map to a color. :type value: float :param scale_name: Name of the color scale from COLOR_SCALES. :type scale_name: str, default="prolint" :param vmin: Minimum value of the range. :type vmin: float, default=0 :param vmax: Maximum value of the range. :type vmax: float, default=1 :returns: Hex color string. :rtype: str .. py:function:: get_unit_label(unit: str) -> str Get display label for a time unit. :param unit: Time unit code (e.g., "us", "ns", "ps"). :type unit: str :returns: Human-readable unit label (e.g., "μs", "ns", "ps"). :rtype: str .. py:function:: get_colormap(name: str = 'viridis') Get a matplotlib colormap by name. :param name: Color scale name from COLOR_SCALES. :type name: str, default="viridis" :returns: Matplotlib colormap object. :rtype: LinearSegmentedColormap :raises ValueError: If name is not a valid color scale. .. py:function:: interpolate_color(value: float, min_val: float, max_val: float, gradient_name: str = 'sharedContacts') -> Tuple[float, float, float, float] Interpolate a color from a gradient based on value. :param value: Value to interpolate. :type value: float :param min_val: Minimum value in range. :type min_val: float :param max_val: Maximum value in range. :type max_val: float :param gradient_name: Gradient name from GRADIENTS. :type gradient_name: str, default="sharedContacts" :returns: RGBA color tuple with values in 0-1 range. :rtype: tuple of (float, float, float, float) .. py:data:: PLOT_STYLE .. py:function:: apply_prolint_style() Apply ProLint plotting style to matplotlib. Updates matplotlib rcParams with ProLint theme colors and fonts. Called automatically by plotter classes.