Quantum mechanics teaches us nature isn't continuous though.
The energy levels of electrons bound to atoms/molecules are quantized, and therefore the energy levels of photons emitted/absorbed (when those electrons change energy levels) are quantized.
But as far as I understand that is just the result of constraints imposed by the atom/molecule "box". Like how a guitar string can only vibrate at certain frequencies because an integer multiple of wavelengths of the standing wave must fit on the string.
Outside of such systems, energy levels are not quantized. For example, photons from distant galaxies appear to be redshifted on a continuous spectrum.
And even within the box the energy levels can be varied continuously if, for example, you squeeze the molecule or put it in an electric field.