code: def set_color(index, color):
      
      if OS == "Darwin" and index < 20:
          return "\033]P%1x%s\033\\" % (index, color.strip("#"))
  
      return "\033]4;%s;%s\033\\" % (index, color)
docs: Convert a hex color to a text color sequence.