  Photochromic oxygen-containing yttrium hydride has been synthesized using a
two step process. The process consists of an initial sputter deposition of
oxygen-free yttrium hydride YH$_\mathrm{x}$, followed by a controlled reaction
with air that causes incorporation of oxygen into the material. An in-situ
study of the YH$_\mathrm{x}$ as it reacted with oxygen was made possible by
applying an aluminium capping layer with a low but non-zero oxygen permeability
prior to air exposure. During the reaction, the visual appearance of the
YH$_\mathrm{x}$ went from dark and opaque to transparent and yellowish. This
transition was accredited incorporation of oxygen into the material, as shown
through analysis with energy dispersive x-ray spectroscopy (EDS) and x-ray
photoemission spectroscopy (XPS). Grazing incidence x-ray diffraction (GIXRD)
studies revealed an fcc structure both before and after oxygen exposure, with a
lattice parameter that increased from 5.2 {\AA} to 5.4 {\AA} during the
reaction. With the lattice parameter in the oxygen free YH$_\mathrm{x}$ being
equal to that reported earlier for YH$_\mathrm{2}$, our findings suggest that
the non-reacted YH$_\mathrm{x}$ in this study is in-fact YH$_\mathrm{2}$.
