A replacement light tube for replacing a fluorescent light tube includes a bulb portion having a first end and a second end, a first end cap and a second end cap disposed at the first end and the second end, respectively, each configured to fit with a socket for the fluorescent light tube, a plurality of light emitting diodes disposed inside and extending between the first and second ends of the bulb portion, wherein the plurality of light emitting diodes is arranged to provide light through at least a portion of the bulb portion and power supply circuitry configured to receive power from a power source and configured to regulate the intensity of light emitted from the plurality of light emitting diodes by pulse-width modulating the received power.