what the color of an item name means
Every item carries a rarity value, and the only place you normally see it is the color of the item name when you hover over it. It is a rough index of how valuable something is and how much work went into getting it, not a measure of power. The practical use is speed. You can tell at a glance whether a drop is worth stopping for, and a color you have never seen before means you have reached something new.
The scale tracks progression more than anything else. Surface and early underground loot sits at the bottom, hardmode ore gear moves you up several steps, and the top of the range is reserved for what comes out of the lunar events. Because the value is written per item rather than calculated from stats, there are outliers in both directions, and a high color on a weak weapon usually means it was hard to obtain rather than good.
modifiers move the color
Reforging changes rarity. A modifier can push an item up or down by as much as two tiers, so two copies of the same weapon can sit in your inventory showing different colors. That is worth knowing before you use color as a sorting rule in a storage room, because the same sword will not always land in the same bucket. The prefixes list covers which modifiers do what.
the part that actually affects play
Rarity has one real mechanical consequence, and it is destructive. Items below the cutoff burn up when they land in lava and end up half submerged in it. Anything above the cutoff is immune and will float there indefinitely.
There is a hand written exception list under that cutoff, and it reads like an inventory of what you carry while working near lava: buckets full and empty, the inlet and outlet pumps, minecart track and its variants, obsidian, and fireblossom with its seeds. Those survive regardless of their tier. Everything else down there is gone the moment it goes under, which is why hellstone mining costs people so much loose material.
colors that lie to you
A few effects paint over the real value. The Sonar Potion and the Void Bag both apply a color mask on top of the normal tier, so what you see in those situations is not what the item is set to. Quest items are the other case. Give one a modifier that would raise its rarity and it jumps to a separate quest color rather than continuing up the ladder, which is easiest to see on something like the Announcement Box.
Items with no rarity written into the code fall back to the default value rather than breaking, so an unfamiliar color is not always meaningful.
one decorative use
The Item Flask takes its liquid color from the rarity of whatever you put inside it. If you want a specific liquid shade in a build, choosing the item by its tier is how you get it, and it is the only place this value does something on purpose rather than by accident.

