gandalf was grey at one point, yes. he was a member of an order of wizards that noone really knew/knows what they were doing on middle-earth. in the books there is also described one who is called "... The Brown".
saruman is white for he is the most powerful, and wisest of the order.
gandalf becomes white because HE becomes what saruman was intended to become, thus gaining a lot of power.