From the FBI website...
This statute makes it a crime for any person acting under color of law, statute, ordinance, regulation, or custom to willfully deprive or cause to be deprived from any person those rights, privileges, or immunities secured or protected by the Constitution and laws of the U.S.This law further prohibits a person acting under color of law, statute, ordinance, regulation or custom to willfully subject or cause to be subjected any person to different punishments, pains, or penalties, than those prescribed for punishment of citizens on account of such person being an alien or by reason of his/her color or race.
Acts under "color of any law" include acts not only done by federal, state, or local officials within the bounds or limits of their lawful authority, but also acts done without and beyond the bounds of their lawful authority; provided that, in order for unlawful acts of any official to be done under "color of any law," the unlawful acts must be done while such official is purporting or pretending to act in the performance of his/her official duties. This definition includes, in addition to law enforcement officials, individuals such as Mayors, Council persons, Judges, Nursing Home Proprietors, Security Guards, etc., persons who are bound by laws, statutes ordinances, or customs.
Punishment varies from a fine or imprisonment of up to one year, or both, and if bodily injury results or if such acts include the use, attempted use, or threatened use of a dangerous weapon, explosives, or fire shall be fined or imprisoned up to ten years or both, and if death results, or if such acts include kidnapping or an attempt to kidnap, aggravated sexual abuse or an attempt to commit aggravated sexual abuse, or an attempt to kill, shall be fined under this title, or imprisoned for any term of years or for life, or both, or may be sentenced to death.
Now, if an official were to be engaging in other activities, let's say ... drug transactions, then that would not be considered an act of that person's official duties, even when performed during work hours or in work uniforms.
If, however, an official took vengeance on a person who they had a greivance with - such as false charges and buying false witnesses - and was able to perpetrate these charges as part of their official position, the scenario is exactly what this statute is addressing.
When an official commits crimes over and over again, that falls under the RICO Act...