code: def rgb_to_rgb_percent(rgb_triplet):
      
      # In order to maintain precision for common values,
      # 256 / 2**n is special-cased for values of n
      # from 0 through 4, as well as 0 itself.
      specials = {255: '100%', 128: '50%', 64: '25%',
                   32: '12.5%', 16: '6.25%', 0: '0%'}
      return tuple([specials.get(d, '%.02f%%' % ((d / 255.0) * 100)) \
                    for d in normalize_integer_triplet(rgb_triplet)])
docs: Convert a 3-tuple of integers, suitable for use in an ``rgb()``
      color triplet, to a 3-tuple of percentages suitable for use in
      representing that color.
  
      This function makes some trade-offs in terms of the accuracy of
      the final representation; for some common integer values,
      special-case logic is used to ensure a precise result (e.g.,
      integer 128 will always convert to '50%', integer 32 will always
      convert to '12.5%'), but for all other values a standard Python
      ``float`` is used and rounded to two decimal places, which may
      result in a loss of precision for some values.
  
      Examples:
  
      >>> rgb_to_rgb_percent((255, 255, 255))
      ('100%', '100%', '100%')
      >>> rgb_to_rgb_percent((0, 0, 128))
      ('0%', '0%', '50%')
      >>> rgb_to_rgb_percent((218, 165, 32))
      ('85.49%', '64.71%', '12.5%')