With these new "clear glass" headlamps, it's the bulb cover and the reflector behind the bulb alone that shape the beam (i.e. send it off into the gutter). In years gone by, it was the actual headlamp glass that shaped the beam using lots of small prisms (hence, the glass wasn't "clear").
So, afaik, the painted parts in that imnage don;t actually have anything to do with the function of the headlamp (i.e. projecting light). If you look closely, the actual reflectors are still unpainted, so I guess these woudl still be legal.
There is a geocities (i think) page somewhere detailing the process (including the baking the lamp to get the glue to soften

) -- can't seem to find it on google, though...
Deek.