code: def _get_struct_gradient(self, shape_number):
          
          obj = _make_object("Gradient")
          bc = BitConsumer(self._src)
          obj.SpreadMode = bc.u_get(2)
          obj.InterpolationMode = bc.u_get(2)
          obj.NumGradients = bc.u_get(4)
          obj.GradientRecords = gradient_records = []
  
          for _ in range(obj.NumGradients):
              record = _make_object("GradRecord")
              gradient_records.append(record)
              record.Ratio = unpack_ui8(self._src)
              if shape_number <= 2:
                  record.Color = self._get_struct_rgb()
              else:
                  record.Color = self._get_struct_rgba()
          return obj
docs: Get the values for the GRADIENT record.