To obtain different colors, the lightsaber needs to use different working gases.Back to the lightsaber. The magnetic field will contain charged particles, but have no effect on the neutral gas particles in the air. Perhaps this is the factor that determines the length of the lightsaber, and the plasma must be very dense at the hilt and gradually dissipate at the end. Note that the magnetic field has no effect on neutral particles, so it cannot keep atmospheric gases out of the "magnetic bottle".
The color of the plasma glow is determined by the level of atomic energy in the ionized gas. Thus neon plasma is red, argon plasma is pinkish purple, and oxygen plasma tends to be green. According to Wikipedia, the color of a lightsaber is controlled by a "kyber crystal". This makes sense for lasers, where the color is controlled by the leap energy levels of electrons in the crystal material, but for plasmas, the situation is different.
In order to obtain different colors, the lightsaber needs to use different working gases, or to excite different energy levels of electron leaps. A powerful Jedi can use the Force to change the energy and excite different leap energy levels - but in an Earth-like atmosphere, the main gas is nitrogen, so the plasma glow will be violet-blue. We can look at the color of the aurora borealis. The solar wind plasma is directed by the geomagnetic field into the Earth's atmosphere, and there are many different gases excited at different altitudes (and energies), producing a range of colors.
With current technology, perhaps the best way to do this is to use the plasma to create a heat flow that is bounded by a large magnetic field and composed of ionized gas molecules. This would require a constant replenishment of gas, but creating the confining magnetic field is the hardest part. The magnetic field would be so large and require so much energy that it would be almost impossible to scale down to fit in the palm of your hand, but at least with current technology, it is theoretically "doable.
Back to lasers, the challenge is to stop the beam in free space. This is possible today. Our current understanding of physics does allow for stopping, or "freezing", photons in a crystal. If this technique could be applied to the body of a lightsaber, and in free space, rather than using photonic crystals, it would be possible to create a 1-meter long beam of light whose radiation is always confined to a certain range.
An important feature of a lightsaber is that it can be knocked away by another lightsaber. In this case, the density of the plasma would have to be very high - at least as high as steel. This goes back to the design of capturing plasma with a magnetic vial. Such a magnetic bottle would not only have to capture the plasma, but also collect additional gas from the surrounding atmosphere to concentrate it to a high enough density (a question: would a lightsaber work in outer space?) I think it is possible that there is a magnetic field configuration that makes the magnetic fields of the two lightsabers repel each other.
Please indicate the reprint：To obtain different colors, the lightsaber needs to use different working gases | Best light sabers-2022Light sabers for sale-Star wars light sabers