You can do that with white light, but not in the rainbow, because the wavelengths are spatially already separated. So you would also have to combine them again.
Our eye perceives color as a mix of red, green, blue. The lowest color of the rainbow is red (hue 0 degrees on a color wheel) but our red cones have another sensitivity just above blue, so the rainbow shows as violet (hue 270 degrees) when both blue and red cones are triggered. But here, blue is triggered more than red. Then the rainbow extends into the ultraviolet which doesn't trigger any of our receptors. But the color wheel still has another 90 degrees or so of hue where red gets stronger and blue is weaker. These are not pure spectral colors, because they must activate both red and blue cones at different frequencies, not just a single frequency like violet does.