I have a 5 ele YAGI which, once we can go multi-op portable again in the UK, I shall be taking to the hills with me. The idea being to make it quick and simple to get the dimensions and element positions right when erecting in the half light without looking for pencil or indelible pen marks that tend to rub out/scrape off. I have not painted the whole thing! - just a small area of the thinner diameter reflector plus the directors, where they slide in/out to adjust the length of the element, the paint stops at exactly the right place for the correct dimension. I have used a different colour for each element with a match on the boom I have not done this to the driven element. Now I have done it I find myself thinking: Could this small area of spray paint in any way have affected the antenna? Somehow I think not but...
Generally speaking paint will not affect the performance of the antenna. If the paint contained metal then in theory it might, but even then I doubt a small amount of metal would have an affect.
I would be concerned if the paint covered mating surfaces, like where two sections screwed together.