code: def foreground(background, *options):
      
      def absdiff(a, b):
          return brightnessdiff(a, b)
          # return 3 * brightnessdiff(a, b) + colordiff(a, b)
      diffs = [(absdiff(background, color), color) for color in options]
      diffs.sort(reverse=True)
      return diffs[0][1]
docs: Find the best foreground color from `options` based on `background`
         color.