Why is gaseous carbon dioxide transparent? Some carbon-heavy products of combustion, e.g. soot, are black, as is carbon in other forms, e.g. graphite.  This seems to suggest that carbon is black.
But then how can $\text{CO}$ (carbon monoxide) and $\text{CO}_2$ (carbon dioxide) be invisible?
 A: [Note that this is an answer to an earlier version of the question.]
It is not possible to see either gas: what you are seeing is soot: small particles of carbon suspended in the air.
The reason that soot is associated with CO in everyday life is that both are produced in situations where burning/oxidation is incomplete.  So an engine burning petrol (say) which is getting starved of oxygen will produce at least two products as well as $\mathrm{CO_2}$: CO and C (you will probably also get completely unburned petrol and all sorts of products of that in the exhaust of course).
So in cases where some combustion process is producing a lot of CO you will generally also get a lot of soot, but the two things are quite different.
A: The answer here is that color is not a property of elements alone, but rather of the structures formed from them. Graphite, soot, and carbon (mon/di)oxide are all different kinds of structures, despite all being made of, or at least containing, carbon, and thus are under no obligation to be all the same color. Even pure carbon has a structure - diamond - with at least (approximately) no color, unlike the graphite and soot forms (the latter being a complex jumble of various more simply, orderly-structured forms of carbon as one might expect would form from a chaotic process such as combustion).
(Another property that is like this is magnetism: You may think you can "pull the iron" from your blood with a suitably strong magnet, but you can't. Single atoms of iron, alone, do not react that way to magnetic fields, much less while bound up in heme molecules, which is the form in which they exist when in blood. The magnetic field-seeking property of iron only exists when the iron is in bulk metal form and moreover in the right allotropes [different micro-structures, like carbon with its graphite, soot, and diamond forms].)
The physical reason that different structures produce different colors is that different structures absorb different wavelengths of light, and the reason for this is that they have different natural modes, or frequencies, which light can excite while being essentially unresponsive to other frequencies. Basically, they are forms of resonance, in the same way that a pendulum, for example, best absorbs the energy from pushes at or close to its natural frequency (i.e. one push per full swing), while at a frequency far different, it barely "quivers" in place, accumulating nearly no energy of its own, with its motion effectively being entirely due to the pushing force. Or perhaps, more apropos, how a macroscopic building may have certain natural frequencies at which it will react strongly when subject to vibrations (this has been a source of a few disasters, and Nikola Tesla was said [with likely exaggerations in the storytelling, if it is actually true] to have created a device that shook his building by exciting such a resonant mode hard enough that the police were called). Different kinds of pendula have different frequencies, as do different designs of building (which is good for engineers who need to design buildings to be resistant to such effects so that things like earthquakes, or mad scientists (:g:), can't bring them down), and so also do different kinds of bonds and multi-bond structures, and thus will respond differently to electromagnetic radiation at different wavelengths, esp. and in this case, light.
The only excitable bonds in a gas like carbon dioxide are those in the molecules. These bonds, however, only react to frequencies that are not in the visible spectrum. Nonetheless, they do react in the infrared spectrum: in particular, carbon dioxide peaks at around 15 μm wavelength infrared (long LWIR to short FIR, freq: 20 THz):
http://www.hashemifamily.com/Kevan/Climate/EA_CO2.gif
If you had a camera that could see at this wavelength, the CO2 in the air would indeed absorb, and would effectively render the atmosphere kind of like a fog. In fact, other carbon-containing gases, like methane, absorb at wavelengths for which cameras are generally available:
https://youtu.be/ybdk6ydp-ig?t=112
(Yes it's a commercial for such cameras. No it's not spam. It actually illustrates it - you can see a black cloud escaping from around the vent. You are literally seeing gas - not aerosol, but real honest-to-goodness gas, in this video. Because this is taken at a wavelength at which that gas does absorb.)
and are used as a way to inspect for leaks of these gases at a safe distance - which is rather important as they are combustible and so leaks dangerous, especially up close.
Graphite and soot, on the other hand, are huge networks of bonds, arranged in complex ways, with many different possible things to excite, that happen to create a more-or-less uniform absorption at least in the visible region, and so appear black as most of the light gets swallowed right up.
