The tallest prisoner counts the white hats in front of him. If odd, he calls out "white"; if even he calls out "black".
Then each prisoner down the line makes the same calculation. If the color they compute is different from what was called out before them, they know their color is "white"; if it's the same, their color is "black". They call out their color.