It looks like you have some contamination before the working part, in the water intakes.
Disconnect the water pipes. Drain as much remaining water as you can. Pour bleatch in the pipes and reconnect. Do a full cycle with no clothes.
Do a cycle with only water.
Do the same as with bleatch, but using CLR.
For both, you should work reasonably fast as the pipes' rubber is not made to hold bleatch not CLR.
As a finishing touch: Reverse the hot and cold water pipes and fill once. Put them back in the correct locations.
Electro, January 2013