If it’s being illuminated by sunlight, color does have to do with its temperature. The reason an object is black is because it’s absorbing most of the visible and infrared light wavelengths. A white surface is reflecting almost all of the visible light and infrared wavelengths.
As far as making things cooler, it does matter. If everyone painted their roof white, their building wouldn’t be as hot.
Assuming you mean in sunlight, sunlight transmits heat via infrared, which is an invisible wavelength of light, just below visible red. You’ve seen those red heat lamps in fast food places for sure, right? Well, they put out a lot of infrared. The way to not absorb a color is by reflecting it. So, theoretically, red would be the best color to keep cool, right? Not really, at least in sunlight. Red is better than black or blue, because black and blue absorb all of red including infrared, and because they also absorb other colors – as does red in the other spectra. The other wavelengths of light also generate heat, though not as much as infrared, but it’s still a good amount, so anything other than white heats up a lot. White reflects almost all of it – the presence of all visible wavelengths is perceived as white. So, white stays pretty close to air temperature. So, yeah some things are colored to absorb or reflect light to keep them cooler or hotter. Modern spacecraft are often white to keep them cool in the unfiltered sunlight of space, whereas early spacecraft had mirrored surfaces. White turned out to be cooler.
As long as there are some rays around? Yea.
For example in in Israel they use a kind of solar water boiler that has a black plate aimed at the sun to catch all the heat to heat up water for household use.
On the other hand you got buildings in Greece painted white so they’ll get less hot in the summer sun.
This also works if you want specific rays, for example different plants have slightly different chlorophyll and because of that they absorve different wave lengths .
Latest Answers