Our eyes see color through cones in our retina, where the three different types (S, M, and L) each have a slightly different range of wavelengths to which they are light sensitive. Through the response of these different cones our brains are able to distinguish different wavelengths of light, which we interpret as color. Telescope detectors typically have a much wider range of light sensitivity, which is good if you want to detect a great deal of light, but not so good if you want to observe a particular color range. So many telescopes have filters that block light outside a particular range.
As a case in point, consider the Hubble space telescope. Hubble has a camera that mainly looks at visible light (the Advanced Camera for Surveys, or ACS) and another that mainly gathers infrared light (the Wide Field Camera 3, or WFC3). Since the sensitivity range of each of these cameras is so wide, each has several filters that block all but a narrower region, known as a band. The colors in the figure don’t correspond to the colors we see. Our visible spectrum is roughly the V band, while B is violet to ultraviolet, i is red to near infrared, and all the others are infrared. You can see how the different bands overlap, and how the amount of light each filter lets through can vary. In order to look at the broad spectrum of light from an object (which is not the same as the spectral lines), Hubble images an object through different filters. These images can be combined to create a “color” image. Though often it is a false-color image with different visible colors assigned to each band.
The figure shows another interesting aspect of the spectra, which deals with redshift. The wavelengths of light we observe from an object are not always the wavelengths that object emits. The light from an object can be redshifted or blueshifted due to the motion of the object relative to us, and things like cosmic expansion. For distant objects, the redshift due to cosmic expansion can be pretty severe, pushing visible and even ultraviolet light well into the infrared. The white line in the figure shows the light typically emitted by a distant galaxy at different redshifts (known as z). You can see that by the time you get to about z = 12, most of a galaxy’s light is so far to the infrared that Hubble can only detect a small portion of it. This means for the Hubble telescope, z = 12 is about the largest redshift it can detect.
Still, there’s quite a bit that Hubble can see simply by reading the rainbow.