Camoflage is a legitimate war tactic. So long as you didn't fire before raising your actual flag, it was a legitimate ruse-de-guerre to get closer to an enemy.
Also where the phrase "showing your true colors" comes from. It's pretty neat how phrases centuries or decades removed from relevance still have a place in language!