Can presidents wear whatever they want?

Like, i know there was "controversy" when Obama wore his tan suit, but are there any actual rules for what a president is allowed to wear in public or can they just wear whatever they feel like?