Yui Hongo, from anime/manga series, Fushigi Yuugi, and Riku, from video game series, Kingdom Hearts are two characters whose actions are so complicated that their alignment is complicated.

First, let's compare the two.

They're the best friends of the main protagonists of those works. They are deep, dark characters. They're antagonists, but at the same, they're protagonists. They work for the forces of darkness and share the same reason of wanting to do that: wanting to get their desired person. They have marks to show who they are. Yui has a blue glow on her forehead while Riku has Xenahort's Heartless, Ansem, inside him. Because of working for the forces of darkness, they ended up being pawns of the main antagonists of those works. At least they manage to make up for all the damages they did and renew their friendship with the protagonists. Their relationship with the other characters matched. Yui's relationship with Nakago, Miaka, and Tamahome is like Riku's relationship with Maleficent, Sora, and Kairi.

They also have differences. Yui has divine powers while Riku uses a Keyblade. For a contrast, Yui is 15 to 18 years old while Riku is 15 to 16 years old. While Yui has a mother that is rarely seen, Riku has parents that are never shown, only mentioned. Yui comes from Japan while Riku comes from Destiny Islands.

Now on to their alignment. Are they good or bad?

Yui is good. She is about to have a perfect normal life with Miaka. That is until she entered the book known as "The Universe of the Four Gods". Upon entering, she ended up getting captured by a group of bandits and believes she's been raped. Nakago comes to her rescue before she's raped and makes her think Miaka is to blame for this, not to mention ditching her to be with Tamahome. As a result, Nakago gets her to become the Priestess of Seiryuu and Yui joins his side. From that point, Yui is bad. This would lead to Nakago going to her world and trying to destroy it. Unable to tolerate this scenario, Yui uses her third and final wish to let herself get devour by Seiryuu, giving Miaka the chance to summon Suzaku. Miaka uses her first wish to bring her back from Seiryuu and is found by Keisuke and Tetsuya. As of now, Yui is good.

Riku is bad. Although he has a good natured rivalry with Sora, it seems that he sure is taking risks, not to mention when the darkness came on their island, he just looks calm and collected. Anyway, when he went to Traverse Town, he crosses paths with Maleficent who shows him Sora is hanging out with Donald and Goofy. When he does, Riku thinks he's ditching him and Kairi for them. As a result, Maleficent gives him the power of darkness and Riku joins her side. This would lead to Ansem to take over his body. Later on, he manages to fight him off from the inside to let Kairi, Donald, and Goofy escape and appears back in his own body supporting Mickey into closing the door to Kingdom Hearts while Sora, Donald, and Goofy escape the realm. As of now, Riku is good.