R = (supply − LED Vf) / current. Typical Vf: red ~1.8–2.2 V, green/blue/white ~3.0–3.4 V. Always put a resistor in series with a bare LED on a voltage source — the LED will not self-limit.