Rarity colors are one of the strongest cross-genre conventions in games. Roughly gray (common) → green (uncommon) → blue (rare) → purple (epic) → orange/gold (legendary), climbing in saturation and brightness together. Players judge whether an item is worth picking up from the border color alone, before reading a word of its description.
Higher tiers usually need more than a static color difference, so animation gets layered on — a soft pulsing glow, light travelling around the border, a shimmer sweep, all common on legendaries. It's the same logic as the Von Restorff effect — standing out is what makes something memorable — so the rarer the item, the more it should sensorially insist on that rarity.
Relying on color alone locks out colorblind players, so a second, non-color signal — icon shape, star count, border thickness — should carry the same information. And rarity colors are a promise that can't change mid-game: rewrite what a color means partway through and every bit of intuition players built up breaks.
When to use
Loot, gear, cards, currency — any collectible with multiple tiers of value.