Writing a shadowy character can encompass many different behaviours and attitudes, but for the most part they tend to take on the notion that there is something about them that the readers yet to find out.
A character in the shadows can also mean that someone has yet to reach their full potential, meaning that even the themselves don’t know what they are capable of. Showing that potential has to be dealt slowly over a course of time, rather than in one foul swoop as may be done with a reveal of a “bad guy” shadowy character.
What if you want to show a character coming out of their shell? A timid or otherwise inward character needs time to show what they are capable of, and more so than any other kind of shadowy creature, they are on a path of self discovery. This is slightly different to a character just reaching their potential, because the character knows what they are capable of, but just have to show/prove it. Here the character may not be so confident, and gaining that confidence is a key part of their own personal story.
And then theres always the main type of shadowy figure in stories, the mysterious bad guy. Writing a shadowy character can be difficult sometimes, because you have to strike the balance right. If you make their transformation into the light to far from how they started off in the shadows, it can come off as unrealistic, and even for a story set in a fantasy world, making the characters believable is a necessity. Personally, I would say even more so, because of the fantastical nature of the setting. People need something they know to hang on to, and the best way of doing that is with the characters.
There needs to be a build up to their reveal, woven throughout the story. With a good build up, and reveal can seem to be natural as you have already put in place the idea that said person can be this other person, either good or bad. Revealing ulterior motives
There must be a purpose as to why the character acts like they do, lurking in the shadows. Making an individual sulky for no reason adds nothing to the story, and is a wasted opportunity, where you can make a character with a real purpose.
The build up to the reveal or end state of the character is probably the most important aspect of pulling off the shadowy character. If the reader has gotten to know a character in one state, they must be eased into the idea that they could be something else. Even if you want the reveal to be sudden and shocking, you must first create the ground work for that reveal to be believable.