Pretty sure those rules about hair purely depend on the school. There are some who have rules like those and some that don't.
Honestly, if you have colored hair and go to a school that forbids it, without researching if the school has such a rule beforehand, it's only your own fault if you get in any trouble over it...