Good question, Heidi.
They are both correct, as long as the first one, 'Their hair is of the same color,' follows another sentence where the hair color is mentioned like: His hair is dark brown. And their hair is of the same color.
The second sentence could mean: 'Andy and Mary are brother and sister. Their hair is the same color.'
Or: 'Their hair is the same color as their mother's.'
In both cases, you still need a little context, but in general, they mean the same thing.
I hope this helps.