Mrs Goodsworthys Hats Puzzle

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?
Do you have the answer? Check against our solution!