code: def attr_triple(value):
      
      keys = ['dfg', 'dbg', '1fg', '1bg', '16fg', '16bg', '256fg', '256bg']
      acc = {}
      if not isinstance(value, (list, tuple)):
          value = value,
      if len(value) > 6:
          raise VdtValueTooLongError(value)
      # ensure we have exactly 6 attribute strings
      attrstrings = (value + (6 - len(value)) * [None])[:6]
      # add fallbacks for the empty list
      attrstrings = (2 * ['default']) + attrstrings
      for i, value in enumerate(attrstrings):
          if value:
              acc[keys[i]] = value
          else:
              acc[keys[i]] = acc[keys[i - 2]]
      try:
          mono = AttrSpec(acc['1fg'], acc['1bg'], 1)
          normal = AttrSpec(acc['16fg'], acc['16bg'], 16)
          high = AttrSpec(acc['256fg'], acc['256bg'], 256)
      except AttrSpecError as e:
          raise ValidateError(str(e))
      return mono, normal, high
docs: Check that interprets the value as `urwid.AttrSpec` triple for the colour
      modes 1,16 and 256.  It assumes a <6 tuple of attribute strings for
      mono foreground, mono background, 16c fg, 16c bg, 256 fg and 256 bg
      respectively. If any of these are missing, we downgrade to the next
      lower available pair, defaulting to 'default'.
  
      :raises: VdtValueTooLongError, VdtTypeError
      :rtype: triple of `urwid.AttrSpec`