I would think color plays (or can play) the same role in IF that it does in any other type of game or literature. Color is used to convey genre, tone, etc, in all other media with visual elements, so why not IF? Not every IF has use for color, of course. But I see it as just one more facet that’s available for expressive purposes, if it serves the author’s intent.
There are certainly associations between genre and color (especially apparent in movie posters, for example). I would think all of those color/genre links could potentially transfer over into IF. Of course, subverting those expectations can be interesting, too (like using pastel colors in a horror game for ironic contrast?). And not every game slots neatly into a genre, or wants to lean into the cliches associated with it.
I put a lot of consideration into the color schemes for my games, and it can be an important part of the overall experience. (Although perception of color is never essential to gameplay, and I try to follow best practices for web accessibility. This is a handy tool, BTW, for checking that the light/dark contrast for your text and background meet accessibility standards.)
Fantasy Opera: Mischief at the Masquerade is set in a fantasy version of 17th century Italy, and specifically an opera house. The colors were inspired by photographs of modern recreations of Baroque opera sets. The game uses an antique-looking cream color for its “white,” with an ochre brown background and teal highlights. I don’t know if this indicates a fantasy genre, per se, but definitely suggests the historical setting.
The Secrets of Sylvan Gardens, being a romantic, garden-themed fantasy story, has a palette of soft earthy greens accented with shades of floral purples. I also used changing dark/light schemes to indicate night and day, which play a structural and thematic role in the game.
The Path of Totality is also a nature-themed fantasy game, but the landscape is a bit harsher and colder, a bit more rugged, taking place in a quasi-British Isles wilderness setting (as opposed to Sylvan Gardens’ quasi-Mediterranean garden setting). So I opted for cool, muted greens, with a complementary beige. There are complementary color schemes for night scenes, as well.
Anyway, that’s far more information than probably anyone wanted to know
But there’s a bit of my thought process as someone who probably has stronger-than-average feelings about color as an expressive tool in IF.