Images taken in light wavelengths invisible to us are recorded as brightness and are given colors that match their relative wavelength in the visible light spectrum. Remember that each color of light has its own wavelength; red light has a wavelength of ~750 nanometers, and violet light has a wavelength of ~400 nanometers. All other colors in the spectrum we can see lie between these extremes. Colors that we cannot see have wavelengths that are shorter (ultraviolet, X-ray, gamma-ray) or longer (infrared, microwave, radio) than the visible light spectrum. In a composite image, X-ray data will be given a violet hue because violet has a short wavelength, and infrared data will be given a red hue because red has a long wavelength. It’s a way of ‘compressing’ the total light spectrum into the visible spectrum so we can perceive it. If you want to know more, NASA has a great website describing the meaning of color in images, and instructions on how to process data from space telescopes yourself!