Whitish, grayish, or clay-colored stool indicates a lack of bile. It may hint at problems with the liver and gallbladder as these are organs where bile is produced and stored. It can be anything from blocked bile ducts and gallstones to cirrhosis.
A green color may be caused by the consumption of vegetables rich in chlorophyll (like spinach), green food coloring in drinks, and iron supplements.
Yellow stool can be a sign of blocked bile ducts and poor fat absorption. Another reason is a lack of enzymes produced by the pancreas, which may hint at chronic pancreatitis, celiac disease, and cystic fibrosis.
Black stool may appear because of medicine intake (like aspirin, ibuprofen, and iron supplements) or bleeding in the intestines. The latter is obviously a reason to contact your doctor immediately.
Red stool is usually influenced by your diet. Beets, colored drinks, tomatoes...just think about what you have consumed recently.