Is this Tenkai Knights (2013–2014)...?
From MyAnimeList:
Tenkai Knights is an original Canadian-Japanese anime series that officially aired in Cartoon Network in the United States on August 24, 2013 and in Canada on Teletoon on September 28, 2013. The anime premiered a year after in Japan on TV Tokyo. The purpose of the anime's creation was the promotion of Spin Master's line of Ionix construction bricks. Spin Master is a Canadian toy and entertainment company which started producing and promoting The Tenkai Knights toy line along with a new Pokémon line. The anime was adapted into a video game for Nintendo 3DS.
The two main characters in the first episode are Guren Nash, a boy with red hair, and Ceylan Jones, a boy with blue hair. Guren has just moved to Benham City with his father, and after his first day at his new school, he and Ceylan go to a shopping mall together and wander into a mysterious antique shop, where they find a pair of Lego-like bricks which can be transformed into mini-robot figures. The shop owner, Mr. White, lets the boys keep the toys as a gift, and later that night, they have a dream about a battle between two robot-like beings.
The next day, they go back to the shop, but Mr. White is nowhere to be found, so they wander downstairs to the basement, where they discover a device that transports them to a distant planet named Quarton. This planet is home to two warring races of robot-like beings, like the ones they saw in their dreams; the benevolent Corekai and the malevolent Corrupted, led by Vilius. On this planet, the boys inhabit the robot-like forms of Bravenwolf and Tributon, two of the legendary Tenkai Knights who aided the Corekai against the Corrupted in the past.
In the second episode, the boys meet two more Tenkai Knights, Valorn and Lydendor, who also turn out to be boys from Earth named Toxsa Dalton and Chooki Mason, respectively; Toxsa has green hair while Chooki has yellow hair.