I'm new here and I have a question that might be simple but I just couldn't find an answer after googling for a while.
I have some buttons in my browser game that are green with a white text. When I hover over them, I change the rgba with CSS and the green becomes more transparent:
#oneOfTheButtons:hover {
background: rgba(76, 175, 80, 0.7) !important;
}
The white text stays the same. I also have some Javascript that changes the color if the player goes level up:
document.getElementById("oneOfTheButtons").style.background = "rgba(77, 173, 173, 1)";
Then the buttons are blue. But the problem is that a hover still makes them transparent green, but I want them to be a transparent blue. I have 20 more levels like that with different colors.
Is there any simple solution for this?