In this case, the foal has a kind of hemolytic anemia called neonatal isoerythrolysis, a disease where the foal’s antibodies (from the mother’s colostrum) are attacking the foal’s own red blood cells.
The yellow color comes from excess bilirubin (a breakdown product of hemoglobin from phagocytized RBCs) in the tissues.