def treescope_color(self) -> str | tuple[str, str]:
    """Computes a CSS color to display for this object in treescope.

    This function can be overridden to change the color for a particular object
    in treescope, without having to register a new handler.

    Returns:
      A CSS color string to use as a background/highlight color for this object.
      Alternatively, a tuple of (border, fill) CSS colors.
    """
    # By default, we render structs in color if they define __call__.
    if hasattr(self, "__call__"):
      from treescope import formatting_util  # pylint: disable=import-outside-toplevel

      type_string = type(self).__module__ + "." + type(self).__qualname__
      return formatting_util.color_from_string(type_string)
    else:
      return "transparent"
Computes a CSS color to display for this object in treescope.

    This function can be overridden to change the color for a particular object
    in treescope, without having to register a new handler.

    Returns:
      A CSS color string to use as a background/highlight color for this object.
      Alternatively, a tuple of (border, fill) CSS colors.
    
penzai/core/struct.py