Are you trying to add a visual effect to the applet, or you really need a very accurate calculation for the magnetic field insode the magnet?

The magnetic field of the above applet were calculated with finite number of current loop.
The magnetic field strength is inverse proportional to distance squrare.
So the error dur to field calculation become too large. May be that is the reason you try to "saturate: it.

I would suggest you just calculate the field at one of the end point as the magnetic field inside the magnet. i.e. assume the field is uniform inside the magnet (the same vector as the field at the center of end point).