The M18 Colored Smoke Grenade is a US Army grenade used as a ground-to-ground or ground-to-air signaling device, a target or landing zone marking device, or a screening device for unit maneuvering. The M18 replaced the World War II M16 which did not burn as long or as vividly. Both were produced at the same time as the M16 production line was already setup when the M18 was adopted. The M16 was available in the same colors as the M18, but also blue, orange, and black. The M18 initially were going to be produced in the same colors including white, but it was decided to limit it to four colors for simplicity. It is not designated the "AN-M18" but "M18." It can be seen during the "Purple Haze" scene, in the film Apocalypse Now (1979). It was discovered in Vietnam that the green smoke drove away swarming bees. When a ground element popped smoke to identify its location to aircraft, the aircraft was not told the color, but told to identify the color they saw. This prevented the VC/NVA if monitoring the frequency from popping smoke of the same color to confuse the aircraft. For additional security the colors were sometimes identified as cherry (red), lime (green), lemon or banana (yellow), or grape (violet).
AN M18 Wikipedia
With both the white AN-M8 and M18, there is a danger of starting a fire if it is used in a dry area. Expended smoke grenade canisters remain hot for some time after burning out and should not be picked up bare-handed. New smoke mixtures are under development that are less harmful if the smoke is inhaled for prolong periods. In enclosed spaces the smoke displaces oxygen and can cause respiratory or oxygen deprivation.