They have syringes of tooth paste of each colour and they place the top of the three syringes at the neck of the tube an squeese so the the tube is filled with three different colours.
this one was on how2!! The actual tube of toothpaste is white and there are 2 sections at the top one has (e.g.) a red bit and the other a blue bit in which the white bit 'picks up' on its way through the nozzel, if that makes sense!
Imagine you sellotaped a paintbrush covered in white paint to your ar5e, if you were then to look back into the bowl after a .... movement your..ahem..stools would appear to be.... whatever colour they normally are, but with a white stripe.
It's a post production effect.
Hope this helps clarify the points raised ;)
have you ever cut opened a toothpast tube, inside are 3 compartments and each one is filled with a different coloured stripe, so when it is sqeezed out of the tube hence the stripes logic init LOL