class_docstr: Cach which maps (r, g, b) tuples to 256 colors.
code: def __init__(self):
      # Build color table.
      colors = []
  
      # colors 0..15: 16 basic colors
      colors.append((0x00, 0x00, 0x00))  # 0
      colors.append((0xCD, 0x00, 0x00))  # 1
      colors.append((0x00, 0xCD, 0x00))  # 2
      colors.append((0xCD, 0xCD, 0x00))  # 3
      colors.append((0x00, 0x00, 0xEE))  # 4
      colors.append((0xCD, 0x00, 0xCD))  # 5
      colors.append((0x00, 0xCD, 0xCD))  # 6
      colors.append((0xE5, 0xE5, 0xE5))  # 7
      colors.append((0x7F, 0x7F, 0x7F))  # 8
      colors.append((0xFF, 0x00, 0x00))  # 9
      colors.append((0x00, 0xFF, 0x00))  # 10
      colors.append((0xFF, 0xFF, 0x00))  # 11
      colors.append((0x5C, 0x5C, 0xFF))  # 12
      colors.append((0xFF, 0x00, 0xFF))  # 13
      colors.append((0x00, 0xFF, 0xFF))  # 14
      colors.append((0xFF, 0xFF, 0xFF))  # 15
  
      # colors 16..232: the 6x6x6 color cube
      valuerange = (0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF)
  
      for i in range(217):
          r = valuerange[(i // 36) % 6]
          g = valuerange[(i // 6) % 6]
          b = valuerange[i % 6]
          colors.append((r, g, b))
  
      # colors 233..253: grayscale
      for i in range(1, 22):
          v = 8 + i * 10
          colors.append((v, v, v))
  
      self.colors = colors
  
imports: from __future__ import unicode_literals
  from prompt_toolkit.filters import to_simple_filter, Condition
  from prompt_toolkit.layout.screen import Size
  from prompt_toolkit.renderer import Output
  from prompt_toolkit.styles import ANSI_COLOR_NAMES
  from six.moves import range
  import array
  import errno
  import os
  import six
label_desc: Use image node_id 1 to create a new _256ColorCache object from inherited base classes: dict with example: obj = _256ColorCache()