I don't think you understsand, an LED is plugged into a #pin, AnalogWrite gives it 1023/1023 units of brightness since that is the LED's capacity, and it stays on untill I turn it off.
You can make some rule for yourself never to use analog outside of 255, but It physically works for me.