class_docstr: Inspired by pygments/formatters/terminal256.py
class_docstr_tok: ["Inspired","by","pygments\/formatters\/terminal256.py"]
code: def _color_indexes(self, color):
      indexes = self.best_match.get(color, None)
      if indexes is None:
          try:
              rgb = int(str(color), 16)
          except ValueError:
              rgb = 0
  
          r = (rgb >> 16) & 0xFF
          g = (rgb >> 8) & 0xFF
          b = rgb & 0xFF
          indexes = self._closest_color(r, g, b)
          self.best_match[color] = indexes
      return indexes
  
imports: from __future__ import unicode_literals
  from ctypes import windll, byref, ArgumentError, c_char, c_long, c_ulong, c_uint, pointer
  from ctypes.wintypes import DWORD, HANDLE
  from prompt_toolkit.renderer import Output
  from prompt_toolkit.styles import ANSI_COLOR_NAMES
  from prompt_toolkit.win32_types import CONSOLE_SCREEN_BUFFER_INFO, STD_OUTPUT_HANDLE, STD_INPUT_HANDLE, COORD, SMALL_RECT
  import os
  import six
label_desc: Use image node_id 4 for calling the ColorLookupTable obj's underlying member method code with example usage: obj._color_indexes(color) and returns: indexes