legitimately
Legally means in a valid or authorized way. When you say that something is legally red, that means that it has the appropriate color and is not fake.
The paint is not legally red, because it's not approved by the government.
He can't legally vote because he's not a citizen.