The Hubble Space Telescope's cameras take individual images for different wavelengths of light and then astronomers combine them to create space images like these. The individual frames themselves aren't in colour, but by combining images taken through different filters and giving each one a colour they can make the amazingly detailed space pictures we all know and love.
This is star cluster NGC 346. The black and white image on the left reveals some of the nebula's structure, but it really comes to life in the colour image on the right, which is a combination of optical and infrared wavelengths.