How do I make my dome light fade away when you shut the door?

Maybe a properly rated capacitor in series with the light