class_docstr: Cache for VT100 escape codes. It maps
  (fgcolor, bgcolor, bold, underline, strike, reverse) tuples to VT100
  escape sequences.
  
  :param true_color: When True, use 24bit colors instead of 256 colors.
class_docstr_tok: ["Cache","for","VT100","escape","codes",".","It","maps","(","fgcolor",",","bgcolor",",","bold",",","underline",",","strike",",","reverse",")","tuples","to","VT100","escape","sequences",".",":","param","true_color",":","When","True",",","use","24bit","colors","instead","of","256","colors","."]
docstr: Turn 'ffffff', into (0xff, 0xff, 0xff).
docstr_tok: ["Turn","'ffffff","'",",","into","(","0xff",",","0xff",",","0xff",")","."]
code: def _color_name_to_rgb(self, color: str) -> tuple[int, int, int]:
      "Turn 'ffffff', into (0xff, 0xff, 0xff)."
      try:
          rgb = int(color, 16)
      except ValueError:
          raise
      else:
          r = (rgb >> 16) & 0xFF
          g = (rgb >> 8) & 0xFF
          b = rgb & 0xFF
          return r, g, b
  
imports: from __future__ import annotations
  import io
  import os
  import sys
  from typing import Callable, Dict, Hashable, Iterable, Sequence, TextIO, Tuple
  from prompt_toolkit.cursor_shapes import CursorShape
  from prompt_toolkit.data_structures import Size
  from prompt_toolkit.output import Output
  from prompt_toolkit.styles import ANSI_COLOR_NAMES, Attrs
  from prompt_toolkit.utils import is_dumb_terminal
  from .color_depth import ColorDepth
  from .flush_stdout import flush_stdout
label_desc: Use image node_id 3 for calling the _EscapeCodeCache obj's underlying member method code with example usage: obj._color_name_to_rgb(color) and returns: r,  g,  b