Changing Minecraft's item rarity color

In theory, you could use a datapack to detect the item in the player's mainhand (since that is the only time you will see the name's color) and modify the item data to change the name color.

This would require a list of all the items and depending on the version of Minecraft you are playing, you may have to use a difficult method to modify the player's mainhand item data; fortunately, in 1.17 this becomes very simple with the new /item command.