Fantasy musical “Wonka” bounced back to the top of the North American box office this New Year’s weekend as an otherwise pallid film year came to an end, industry watcher Exhibitor Relations reported Sunday.

The Warner Bros. film took in an estimated $24 million for the three-day weekend in the U.S. and Canada, and $31.8 million when New Year’s Day is included. It has passed the $140 million mark domestically and taken in $244 million globally.

That strong showing came at the end of an off year for Hollywood, with numbers roughly 20 percent below the three-year pre-pandemic average, said analyst David A. Gross. Audience tastes are starting to change, he said, from universe-saving action films to stories closer to home.

Close to home — at least if you live near a chocolate factory — was family-friendly “Wonka,” with Timothee Chalamet as a younger version of Roald Dahl’s famous chocolatier. Hugh Grant has an unforgettable turn as a grouchy, green-haired, gnome-like Oompa Loompa.

Last weekend’s leader, Warner Bros.’ “Aquaman and the Lost Kingdom,” took on a bit of water, slipping to second at $19.5 million for three days ($26.3 million for four). Jason Momoa again plays the sea-dwelling superhero, this time joining with his half-brother and former foe to fight turmoil and climate change.

In third was Illumination and Universal’s animated comedy “Migration” about the adventures of a family of mallard ducks as they fly from New England to Jamaica. It earned $17.2 million for three days ($23 million for four).

Completing a strong weekend for Warner Bros. was the new musical version of “The Color Purple,” in fourth spot at $13 million ($17.7 million). Based on the Alice Walker novel that became a beloved movie, “Purple” follows the struggles and triumphs of Celie, a young Black woman in rural Georgia in the early 20th century.

One-time “American Idol” winner Fantasia Barrino-Taylor plays Celie — a role played by Whoopi Goldberg in the 1985 film — with backing from Danielle Brooks, H.E.R. and Colman Domingo.

And in fifth was Sony rom-com “Anyone But You,” at $9 million ($11.5 million). Sydney Sweeney and Glen Powell star in the tale, oh-so-loosely based on Shakespeare’s “Much Ado About Nothing,” that takes the two from instant connection to crossed signals to the scheming of friends to a lot of splashing in Sydney Harbour before ultimately … but nay, the rest is silence.

Rounding out the top 10 were:

1. “Wonka,” $24 million.

2. “Aquaman and the Lost Kingdom,” $19.5 million.

3. “Migration,” $17.2 million.

4. “The Color Purple,” $13 million.

5. “Anyone But You,” $9 million.

6. “The Boys in the Boat,” $8.3 million.

7. “The Iron Claw,” $5 million.

8. “Ferrari,” $4.1 million.

9. “The Hunger Games: The Ballad of Songbirds and Snakes,” $2.9 million.

10. “The Boy and the Heron,” $2.5 million.