Well, yes, there are sunglasses which can change with light. Generally speaking, when stuck with prescription eyeglasses, the bright sunlight is hard on the eyes. And at this moment, you can just try photochromic sunglasses, which are commonly referred to as transitions lenses. For the special function, you should know that this kind of sunglasses will darken when exposed to uv rays and turn clear when not. So they are popular with many people. So you can just buy them and have a try.
It is the anti-glare sunglasses. When you are indoors, the lenses will be transparent. When you are out, the lenses will be dark. They will change the color with the environment. The sunglasses own the transition lenses. If you want to such one, you could go to the online store to have a search. It will be cool for you wherever you are.