Can one wear sunglasses or transition lenses on Shabbos or Yom Tov?
It is permitted to wear transition lenses on Shabbos and Yom Tov, and this is not considered an act of ‘painting’.
However, one should not wear sunglasses in the public domain on Shabbos, for fear that one would take them off in shaded places. This concern would not apply to ‘transition lenses’ or ‘clip-ons’, which are never removed from the glasses.
Sources: See Shulchan Aruch 301:22 — anything that serves the body is considered as clothing, and as part of the body itself, so that it is permitted to wear on Shabbos. However, items that are sometimes taken off may not be carried in the public domain, for fear of taking them off and carrying them. See Shemiras Shabbos Kehilchasah 18:18, and see sources in Yalkut Yosef 301:35.
Concerning tainted lenses, the melachah of tzove’a is not applcable, firstly because there is no permanent change, and also because no paint is applied, and the change is internal to the lens. In addition, no direct action is applied to the lens. See Shemiras Shabbos chap. 18, note 70, and note to se’if 16; see also discussion in Avnei Yashfei Vol. 2, no. 39.