class_docstr: Adjust the brightness to improve the rendering on either dark or light
  backgrounds.
  
  For dark backgrounds, it's best to increase `min_brightness`. For light
  backgrounds it's best to decrease `max_brightness`. Usually, only one
  setting is adjusted.
  
  This will only change the brightness for text that has a foreground color
  defined, but no background color. It works best for 256 or true color
  output.
  
  .. note:: Notice that there is no universal way to detect whether the
            application is running in a light or dark terminal. As a
            developer of an command line application, you'll have to make
            this configurable for the user.
  
  :param min_brightness: Float between 0.0 and 1.0 or a callable that returns
      a float.
  :param max_brightness: Float between 0.0 and 1.0 or a callable that returns
      a float.
class_docstr_tok: ["Adjust","the","brightness","to","improve","the","rendering","on","either","dark","or","light","backgrounds",".","For","dark","backgrounds",",","it","'s","best","to","increase","`","min_brightness","`",".","For","light","backgrounds","it","'s","best","to","decrease","`","max_brightness","`",".","Usually",",","only","one","setting","is","adjusted",".","This","will","only","change","the","brightness","for","text","that","has","a","foreground","color","defined",",","but","no","background","color",".","It","works","best","for","256","or","true","color","output",".","..","note",":",":","Notice","that","there","is","no","universal","way","to","detect","whether","the","application","is","running","in","a","light","or","dark","terminal",".","As","a","developer","of","an","command","line","application",",","you","'ll","have","to","make","this","configurable","for","the","user",".",":","param","min_brightness",":","Float","between","0.0","and","1.0","or","a","callable","that","returns","a","float",".",":","param","max_brightness",":","Float","between","0.0","and","1.0","or","a","callable","that","returns","a","float","."]
docstr: Parse `style.Attrs` color into RGB tuple.
docstr_tok: ["Parse","`","style.Attrs","`","color","into","RGB","tuple","."]
code: def _color_to_rgb(self, color: str) -> tuple[float, float, float]:
      """
      Parse `style.Attrs` color into RGB tuple.
      """
      # Do RGB lookup for ANSI colors.
      try:
          from prompt_toolkit.output.vt100 import ANSI_COLORS_TO_RGB
  
          r, g, b = ANSI_COLORS_TO_RGB[color]
          return r / 255.0, g / 255.0, b / 255.0
      except KeyError:
          pass
  
      # Parse RRGGBB format.
      return (
          int(color[0:2], 16) / 255.0,
          int(color[2:4], 16) / 255.0,
          int(color[4:6], 16) / 255.0,
      )
  
imports: from __future__ import annotations
  from abc import ABCMeta, abstractmethod
  from colorsys import hls_to_rgb, rgb_to_hls
  from typing import Callable, Hashable, Sequence
  from prompt_toolkit.cache import memoized
  from prompt_toolkit.filters import FilterOrBool, to_filter
  from prompt_toolkit.utils import AnyFloat, to_float, to_str
  from .base import ANSI_COLOR_NAMES, Attrs
  from .style import parse_color
label_desc: Use image node_id 3 for calling the AdjustBrightnessStyleTransformation obj's underlying member method code with example usage: obj._color_to_rgb(color) and returns: unknown,  unknown,  unknown, unknown,  unknown,  unknown