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

I tell you what, I will check in my stock room to see if I have any capacitors then I will experiment with some lights and my variable dc power supply, ok.