Expounding on this question, if one shoots someone, does the lawfulness of that other person's actions preclude a self-defense argument? Suppose Alice is a cop in a shootout with Bob. Chuck is behind Bob. Chuck reasonably believes that if Alice continues shooting at Bob, it is very likely that one of the bullets will hit him and kill him. Chuck therefore shoots Alice. Chuck was not in any way affiliated with Bob and did not commit any illegal act before shooting Alice. Can Chuck claim self-defense?
Colorado Revised Statutes Title 18. Criminal Code
§ 18-1-704. Use of physical force in defense of a person
(1) Except as provided in subsections (2) and (3) of this section, a person is justified in using physical force upon another person in order to defend himself or a third person from what he reasonably believes to be the use or imminent use of unlawful physical force by that other person, and he may use a degree of force which he reasonably believes to be necessary for that purpose.
You are only able to act in self-defence if you have a reasonable belief that the individual is acting unlawfully.
In the scenario you present, you say that Charlie is concerned not with the perceived unlawful actions, but actions that are perceived to be lawful, but put Charlies life at risk regardless. In that situation, the self-defence subsection above would not apply.
There is a more general concept of crime of necessity in Colorado law:
§ 18-1-702. Choice of evils
(1) Unless inconsistent with other provisions of sections 18-1-703 to 18-1-707, defining justifiable use of physical force, or with some other provision of law, conduct which would otherwise constitute an offense is justifiable and not criminal when it is necessary as an emergency measure to avoid an imminent public or private injury which is about to occur by reason of a situation occasioned or developed through no conduct of the actor, and which is of sufficient gravity that, according to ordinary standards of intelligence and morality, the desirability and urgency of avoiding the injury clearly outweigh the desirability of avoiding the injury sought to be prevented by the statute defining the offense in issue.
This subsections does make conditionally legal to use force against people who you do not have a reasonable belief are acting unlawfully.
It's important to note that if this were to go to court, a prosecutor would almost certainly seek to prove that § 18-1-702 is inconsistent with § 18-1-704, given the restrictions present in § 18-1-704. The defence would argue that that subsection deals specifically with those that are acting unlawfully, without placing restrictions on § 18-1-702 in other situations.
If a person A is accused of killing (or injuring or assaulting) another person B, A's defense does not depend on whether B was in fact acting lawfully or properly. It depends on whether A had a reasonable belief that B was acting wrongfully, and the B posed an unjustified danger to A, or to others, such as C.
It will also be required for A to show that A reasonably believed that lethal force was needed to stop B from doing serious harm, and that A's use of force was proportionate to the situation.
However, in practice, if B was in fact acting lawfully and properly, it will be much harder for A to convince a jury (or judge) that A's belief that such force was needed was in fact reasonable. Legally, if A had a reasonable but mistaken belief that B was acting unlawfully and that lethal force was needed to stop B, A has a good defense. But it may be hard to convince a jury that A was acting reasonably when A got the facts wrong.
The exact details of the facts will matter a great deal, of course.