I'm setting up an item template for use in a game wiki, but I'm new to wiki editing and am having some trouble with the formatting. I have four colors, one for each rarity type, that I want to show up as the border and text color, based on the item's inputted rarity. Right now, though, the person filling out the itembox needs to put in the exact html code in a color code place.
Is there any way to make it so the rarity field changes the colors? (I found some search results that seemed to indicate it as possible, but it was older code that didn't work for me.)