class_docstr: Inspired by pygments/formatters/terminal256.py
class_docstr_tok: ["Inspired","by","pygments\/formatters\/terminal256.py"]
docstr: Return the color for use in the
  `windll.kernel32.SetConsoleTextAttribute` API call.
  
  :param bg_color: Background as text. E.g. 'ffffff' or 'red'
docstr_tok: ["Return","the","color","for","use","in","the","`","windll.kernel32.SetConsoleTextAttribute","`","API","call",".",":","param","bg_color",":","Background","as","text",".","E.g",".","'ffffff","'","or","'red","'"]
code: def lookup_bg_color(self, bg_color: str) -> int:
      """
      Return the color for use in the
      `windll.kernel32.SetConsoleTextAttribute` API call.
  
      :param bg_color: Background as text. E.g. 'ffffff' or 'red'
      """
      # Background.
      if bg_color in BG_ANSI_COLORS:
          return BG_ANSI_COLORS[bg_color]
      else:
          return self._color_indexes(bg_color)[1]
  
imports: from __future__ import annotations
  import sys
  import os
  from ctypes import ArgumentError, byref, c_char, c_long, c_uint, c_ulong, pointer
  from ctypes.wintypes import DWORD, HANDLE
  from typing import Callable, TextIO, TypeVar
  from prompt_toolkit.cursor_shapes import CursorShape
  from prompt_toolkit.data_structures import Size
  from prompt_toolkit.styles import ANSI_COLOR_NAMES, Attrs
  from prompt_toolkit.utils import get_cwidth
  from prompt_toolkit.win32_types import CONSOLE_SCREEN_BUFFER_INFO, COORD, SMALL_RECT, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE
  from ..utils import SPHINX_AUTODOC_RUNNING
  from .base import Output
  from .color_depth import ColorDepth
label_desc: Use image node_id 6 for calling the ColorLookupTable obj's underlying member method code with example usage: obj.lookup_bg_color(bg_color) and returns: BG_ANSI_COLORS, self