If the headlamp shell is made of plastic you need a flexible paint for plastics or it will crack badly over time.
The flexible paints tend to be quite expensive - not sure if they are available in rattle cans. I would use a local automotive firm who paint bumper sensors they will match any paint code and are not as pricey as you might think.
In Derby we have Chartwells a high end vehicle repairers as well as a variety of Smart Mobile Repairers that paint plastic bumpers etc on a regular basis.