An electron trapped in a tiny crystal behaves like a wave on a string with fixed ends. Only certain standing waves fit, each with its own energy, and shrinking the crystal spreads those energies apart. That's why smaller quantum dots glow bluer.