Second, do not use bright colors that will attract predators or vandals. Mammals such as raccoons and weasels cannot see color, so brightly colored houses are not likely to attract them. Snakes and grackles do see color, however. Third, avoid dark colors on boxes hung in full sunlight. Such boxes are susceptible to overheating.
Light colors reflect rather than absorb light.
I cannot unequivocally recommend white because a white nest box hung on a black-barked tree could attract attention. Use a clear wood sealer, or match the paint color to the color of the object to which the nest box will be attached. White may be particularly suitable for nesting structures hung in the open, such as purple martin houses. Without benefit of shading, exposed nest boxes can become very hot inside. White reflects enough sunlight that it reduces the temperature gain inside the nest box, keeping it safer for nestlings.