code: def _percent_to_integer(percent):
      
      num = float(percent.split('%')[0]) / 100.0 * 255
      e = num - math.floor(num)
      return e < 0.5 and int(math.floor(num)) or int(math.ceil(num))
docs: Internal helper for converting a percentage value to an integer
      between 0 and 255 inclusive.