Urobilin or urochrome is the chemical primarily responsible for the yellow color of urine.
Bilirubin is then excreted as bile, which is further degraded by microbes present in the large intestine to urobilinogen.
[1][2] Some of this remains in the large intestine, and its conversion to stercobilin gives feces their brown color.
When urobilinogen is exposed to air, it is oxidized to urobilin, which has a yellow color.
Obstructive jaundice reduces biliary bilirubin excretion, which is then excreted directly from the blood stream into the urine, giving a dark-colored urine but with a paradoxically low urobilin concentration, no urobilinogen, and usually with correspondingly pale faeces.