Ever wondered how they get the stripes on the toothpaste? Some people even avoid buying those stripy toothpastes just so they don't have to even think about this.
But it's easier than it seems. And no, there are not two separate compartments (cf the drawing below). The tube is filled with the carrier material, the actual toothpaste, which is usually white, to a certain level. Above that level, the tube is filled with the 'stripe' stuff, which is usually red, blue or green. Both materials are viscous enough so that they don't mix. Now the trick is to let these two substances out separate ways but at the same time. The toothpaste nozzle is not just a hole at the top of the tube. Instead, it is a longish pipe that reaches down the tube just ending at the filling level of the carrier material. The pipe has small holes in it further up closer to the nozzle. Pressing the tube will cause the carrier material to enter the outlet pipe and press the stripe stuff. The stripe material will enter the outlet pipe through the small holes, which is where the stripes are generated.
Since the stripes only make up a fraction of the volume, the pipe protruding into the inner part of the tube must not be too long (usually about some fractions of a centimetre).
You can screw up the stripe effect by pressing the tube as close as possible from the nozzle side, forcing the stripe stuff to go through the main outlet. Or you could also knead the tube thoroughly mixing the two substances.
The patent on the method to produce stripes from the tube was bought by Lever (at date of writing: Unilever) from a New York inventor in the late 1950s.
Around 1960 the new toothpaste 'Stripe' was introduced into the American market. A few years later, in 1965, it was introduced as 'Signal' in the UK and then in Europe. 'Stripe' reached 8% market share in its second year and declined from then on. The stripes didn't come out right in every third tube.
New nozzle designs to produce different shapes of stripes with different colours produced a sharp trade mark dispute in the late 1990s.
The stripes are there for the optical effect, but they may also contain different components. For example, the main carrier contains the 'soap', a red stripe containing 'fluoride', and another one might contain the mint aroma for the 'freshness'. However, there is no strict need for the separation of these components.