The whole blue thing may have come from African Americans, especially the Gullah. They called it ‘haint blue’, and often also painted their doors that color, to keep bad spirits away.
Maybe distracting bugs was an extra benefit?
https://en.wikipedia.org/wiki/Haint_blue
Thanks! Never heard that brfore...