  We report first-principles investigations of the coloration of WO$_3$ upon
charge insertion, using sodium tungsten bronze (Na$_x$WO$_3$) as a model
system. Our results explain well the systematic color change of Na$_x$WO$_3$
from dark blue to violet, red-orange, and finally to golden-yellow as sodium
concentration $x$ increases from 0.3 to unity. Proper accounts for both the
interband and the intraband contributions to the optical response are found to
be very important for a detailed understanding of the coloration mechanism in
this system.
