State senators have passed a bill that would change how Colorado’s electoral votes are cast at the college, essentially joining a compact with other states that would award its presidential electoral votes to the winner of the national popular vote.

The measure passed along a party-line vote with Democrats in support.

There are a total of 538 electors among the 50 states, including three votes allotted to the District of Columbia. Currently, 270 electoral votes are needed to win the U.S. presidency.

The Constitution and subsequent legislation specifies the number of electors allocated to each state and how they meet to select the president. Each state determines how electors are chosen. Colorado has nine electoral votes.

In 2000, Democrat Al Gore won the popular vote but lost the electoral majority to Republican George W. Bush. In 2016, Democrat Hillary Clinton won the popular vote but lost the electoral majority to Republican Donald Trump.

A bill proposed by Democrat state Sen. Mike Foote, and legislators in other states, seeks to change this process – hoping to avoid outcomes like the 2000 and 2016 elections.

Foote’s bill would add Colorado to the list of states that already joined a newly formed National Popular Vote Interstate Compact. According to NationalPopularVote.com, the National Popular Vote bill has been enacted into law in 12 states with a total of 172 electoral votes, including California, Connecticut, Hawaii, Illinois, Maryland, Massachusetts, New Jersey, New York, Rhode Island, Vermont, Washington, and Washington, D.C.

The compact would require electors to the Electoral College in each of these 11 states to cast their vote for the winner of the national popular vote.

Currently, Colorado electors vote for the candidate who wins in Colorado, as do all electors except for those in Maine and Nebraska.

"This really is a victory for those who believe that every vote should be counted equally," Foote, D-Lafayette, said. He also tweeted, "The #onepersononevote is on its way to becoming a reality in Colorado."

In order to become official, the measure would first need to be approved by the Democrat-controlled House and the Democratic governor, by other states involved in the pact, and once states totaling 98 or more electoral votes commit.

The Colorado Republican Party said in a statement that the Colorado Senate Democrats "took a step forward in eliminating the Electoral College and adopting a popular vote system." Colorado Republicans opposed the bill, arguing it is unconstitutional.

"It is unclear whether this is constitutional, that will have to be hashed out in the courts," Jon Caldara, president of the Denver-based Independent Institute, told Watchdog.org. "I just can’t figure out why our legislature wants our presidential electors to be beholden to forces outside of our state."

According to Ballotpedia, Colorado has voted the same as the winner of the Electoral College winner in 11 of the last 14 presidential elections. The only election years when the votes differed were in 1976, 1996, and 2016.

According to the compact, if Colorado voters voted the same as the Electoral College, Colorado electors would be required to vote with compact members for the candidate who won the popular vote, regardless if that candidate lost the popular vote in Colorado.

"Proponents of the National Popular Vote are saying that Colorado voters just don’t matter," Caldara added. "I disagree."

If the compact were to gain the number of states totaling 270 electoral votes, it most likely would be opposed in federal court.

Whether the Colorado bill is challenged and taken to the state’s supreme court remains another matter.