SAN FRANCISCO — For a few years, Giants fans have known what staff ace Logan Webb is about.

In a 9-3 win over the Colorado Rockies on Sunday, a crowd of 41,087 began to get a better idea about shortstop Willy Adames.

Webb gave up one run in seven innings to improve his record to 5-2 and Adames, who signed a seven-year, $182 million free agent contract in the offseason, hit a pair of home runs and a booming double to drive in three runs as the Giants won three of four from the Rockies before taking to the road.

It was the season’s third and fourth home runs for Adames, prompting a standing ovation from the fans when he came up in the seventh with the bases loaded. Adames struck out, but the Giants scored four times in the inning anyway to put the game away.

“He’s having really calm at-bats right now,” Giants manager Bob Melvin said of Adames, who came into Sunday hitting .215. “His bat is getting through the zone, and when he gets going, he gets going pretty hot.

“Every game, it seems like his at-bats are getting better and with a couple of home runs today, it feels like he’s off to the races.”

Webb gave up one earned run on 96 pitches with two walks and six strikeouts. He got outs with the first two pitches he threw in the game, and in no inning did he exceed 17 pitches in dropping his earned run average to 2.61.

German Marquez was the losing pitcher, falling to 0-6.

In winning their third straight game following a three-game losing streak, the Giants improved to 22-13, with Colorado, which won the first game of the series, falling to 6-28.

After Sunday’s game, the Giants recalled left-handed starter Kyle Harrison from Triple-A Sacramento and designated Lou Trivino for assignment. Trivino pitched the ninth for the Giants on Sunday in a non-save situation. He gave up no runs, stranding runners at second and third.

In his last start on Wednesday in Sacramento, Harrison struck out seven with no walks and allowed just one earned run over five innings in a 16-6 loss to Reno. Of his 80 pitches, 55 were strikes, with his fastball touching 96-97 mph.

The Giants start a six-game road trip today in Chicago with a three-game set against the Cubs, then, after a day off, play the Minnesota Twins for another three-game series.

Adames’ first home run came on a 10-pitch at-bat against Marquez before he finally got a slider he liked and drove it 392 feet over the left center field fence at 103 miles per hour.

“When I got back to the dugout, I was dead,” Adames said. “When you have an at-bat like that, it builds the confidence, and I feel that’s what it did to me.

“It’s like a competition with just you and him, and you want to beat him. I played with (Marquez) in the minor leagues, so it felt really cool to do it.”

Homer No. 2 was on a 2-0 pitch from Marquez, a four-seam center cut fastball that went 398 feet over the fence.

It’s not the first time Adames has struggled in the season’s first month.

“I was talking to my best friend the other day and he asked me why I suck in April,” Adames said. “I said, `You think I’m trying to suck?’ I’m trying to be good. Doesn’t happen. I think it’s just building the confidence.”

Colorado jumped on Webb quickly in the fifth for its first run with Mickey Moniak hitting a triple to left-center by Luis Matos, followed by a first pitch single from Jacob Stallings to drive him in. An error by Webb on a comebacker by Alan Trejo put runners at first and second with nobody out.

Webb, however, got leadoff batter Brenton Doyle to ground to Matt Chapman at third, who stepped on the base and threw to first for a double play. Webb then retired Jordan Beck on his fourth strikeout.

“It was kind of the typical Logan Webb performance,” Melvin said. “Gets a strikeout when he needs a strikeout. Gets in a jam and gets a double play. It’s kind of how he does things.”

The Giants built their lead in the fifth, with Mike Yastrzemski hitting a bloop two-run single that chased starter Marquez with Adames coming up for the third time with a pair of home runs. No matter, the first pitch reliever Angel Chivilli threw was driven 402 feet to right center by Adames for a double, driving in Yastrzemski.

The inning opened with Matos hitting a double to center, followed by Patrick Bailey finding a spot in right field in front of Moniak for a single to put runners on first and third. Bailey advanced to second on a grounder to first by Christian Koss, which preceded Yastrzemski’s hit.

The Giants expanded the lead to 9-1 in the eighth when Tyler Kinley hit Lee with the bases loaded to drive in one run, and Wilmer Flores dumped a two-run single into shallow left field. Seth Halvorsen was brought in to face LaMonte Wade Jr. and promptly gave up a run-scoring single.

Colorado touched up Spencer Bivins in the eighth with back-to-back triples by Jordan Beck and Ryan McMahon, with McMahon scoring on a groundout by Hunter Goodman.

The multihome run game was the eighth of Adames’ MLB career, with the last one coming on Sept. 14 against Arizona while playing for Milwaukee.

Matos went 2 for 4 with a single and a double and will get his third consecutive start today in Chicago with a left-hander on the mound.

Flores’ two RBIs gave him 31 for the season, the third-most in the majors and the most for a Giants player through 34 games since Moises Alou had 31 in 2006.

Webb’s 50 starts of seven or more innings is tied with Houston’s Framber Valdez for the most in the majors since the start of the 2021 season.

Landon Roupp (2-2, 5.10 ERA) opens the series today at 4:40 p.m. in Chicago against left-hander Matt Boyd (2-2, 2.70).