Mrs Goodsworthys Hats Puzzle - Solution

The Puzzle:

Mrs Goodsworthys Hats
Mrs Goodsworthy has 6 gorgeous hats. 3 are green, 2 are blue, and 1 is canary yellow.

Four of her friends, Janet, Collette, Melanie, and Judith have come for tea and are trying on her hats. Mrs. Goodsworthy helps each friend put on a hat and has them stand in a line as shown below.

None of the ladies can see what color hat she is wearing.
Janet can see the colors of the hats Collette, Melanie, and Judith are wearing.
Collette can see the colors of the hats Melanie and Judith are wearing.
Melanie can see the color of the hat that Judith is wearing.
Judith cannot see the color of any of the hats.

Mrs. Goodsworthy asks her friends what color hat each of them is wearing, and Janet says she can't tell. Collette says she isn't able to tell either, and Melanie says she can't tell.

Judith, on the other hand, is able to announce the color of her hat. How was Judith able to figure out the color of her hat, and what was the color?

Our Solution:

The color of Judith's hat was green.

If Janet and Collette said "I can't tell" it tells Melanie that hers or Judith's is the hat that there were 3 of (i.e., green).

If Melanie saw any other colour she would therefore know that hers was green, but, since she didn't, Judith knew hers was green.

Solution courtesy of wintersolstice, confirmed by phrontister and bob bundy, all of the Math is Fun Forum
See this puzzle without solution
Discuss this puzzle at the Math is Fun Forum