From Sonic Retro
The seven World Rings are a major plot point in Sonic and the Secret Rings. The evil Erazor Djinn used Sonic to get his hands on the rings, so that he could use them to conquer the Arabian Nights book. While his plan initially succeeded, Sonic used the Rings to transform into Darkspine Sonic after Erazor had used them to transform into the monstrous Alf Layla wa-Layla. The World Rings are colored in the same colors as the Chaos Emeralds, and their power requires a sacrifice to unlock. Each ring holds the power of one of the following emotions (in the order Erazor mentioned them): Prayers (Blue), Sadness (Purple), Rage (Red), Hatred (Green), Joy (Yellow), Pleasure (Cyan), and Wishes (White).
They also appear in the sequel, Sonic and the Black Knight, as ring-type items that may appear on the item identification screen upon completion of a Legacy mission. They are unrelated to the plot. Collecting all seven unlocks the song Seven Rings in Hand (Crush 40) in the Gallery.