2016 has not been a jolly good time — more like angry, depressed and anxious. For some, happiness feels like a cruel outdated joke. Within this context, Dreamworks’ “Trolls,” an animated adventure musical with Anna Kendrick and Justin Timberlake voicing the leads, seems like a strange choice for this point in the year. In a cinematic atmosphere increasingly in favor of the dark and gritty, “Trolls” celebrates those who choose happiness, no matter what life throws at them.

Once upon a time, the optimistic Trolls, led by King Peppy, fled their homes to seek refuge from the Bergens, for whom the ingestion of Trolls provides temporary happiness. Twenty years later, King Peppy’s daughter, the sunny Princess Poppy, throws a wild anniversary party, which attracts the attention of the Bergen Chef and results in the abduction of her eclectic friends. Eager to rescue her friends and save her kingdom, Poppy turns to Branch, a troll of drab colors who, for reasons unknown, has spent most of his life in a heavily fortified survival bunker. Opposites clash and attract as the duo risk everything to turn their world around .

The sugar-sweet Poppy and the bitterly paranoid Branch represent opposing ends of an optimism-pessimism spectrum. Beautiful voice work by Anna Kendrick and Justin Timberlake illustrate the complexities and contradictions of both characters, making them more fleshed out. Kendrick convincingly conveys Poppy’s somewhat-naive cheerfulness but also displays her painful process of realizing that, as Branch puts it, “the world isn’t all cupcakes and rainbows.” She finds the possibly psychotic side of Poppy’s happy-go-lucky attitude but doesn’t punish her for it, even when it looks like the character has lost hope. Timberlake steals the show as Branch, whose sarcasm masks a truly heartbreaking source of pain and paves the way for an emotionally moving journey of rediscovery. His performance is fully invested in Branch’s trajectory, with those contagious spirits of belief, love and imagination driving curiosity about who the character really is.

With Timberlake also acting as songwriter and executive music producer, “Trolls” contains a plethora of funky foot-movers that know how to create lasting smiles. Along with classics our parents grew up with, like Simon and Garfunkel’s “The Sound of Silence” and Lionel Ritchie’s “Hello,” the soundtrack includes original music by Timberlake, Gwen Stefani and Ariana Grande. Timberlake’s own song of the summer, “Can’t Stop the Feeling,” is one of those songs where every listen demands unapologetic dancing along. Cyndi Lauper’s “True Colors” becomes the film’s anthem, and said song’s greatest cover, in a ferociously tear-jerking centerpiece scene that easily ranks as one of the year’s greatest film moments.

For its entire 90-minute running time, the film’s never-overbearing electric color palette explodes off the screen, creating a world that can’t be turned away from for fear of missing out on something wonderful. The crisp 3-D, a surcharge well worth the price of admission, adds a tactile feel to the characters, which look like scrapbook felt creations come spectacularly to life. It’s as if the walls of the cinema have floated away, transporting the audience into the world of the trolls.

While animated films may be made with children and families as the target audience “Trolls” is an animated film where even childless adults won’t want to come down from its heavenly happy spell.