It isn't just the Nintendo Switch that recognizes the colors of its controllers, as the type of Joy-Con used by the player character in Pokémon Sword & Shield will be reflected on the player's own console.
The protagonist of almost every Pokémon game has had their own Nintendo console in their bedroom, dating back to the Super Nintendo owned by Red in Pokémon Red & Blue. It seems that the Pokémon world has its own equivalent to Nintendo, but this is never elaborated on within the story of the games. The residents of the Pokémon universe don't seem to be into video games, as they already live in a world full of collectible monsters, so the latest Call of Duty or FIFA game probably wouldn't be as interesting to someone who owns their own dragon.
The player character in Pokémon Sword & Shield continues the "video game console in the bedroom" tradition with their own Nintendo Switch. People who own the regular grey or red and blue Joy-Con combinations may not have noticed anything out of the ordinary with the player's Nintendo Switch, but those who have unconventional Joy-Cons noticed that their colors were matched by the in-game Joy-Cons. I own two blue Joy-Cons, as I accidentally broke the red one that came with the system and managed to find a second blue one. As such, I noticed straight away when the Nintendo Switch in Pokémon Sword & Shield matched my own.
Pokémon Sword & Shield aren't the only programs that do this, as the colors of controllers will show up in an image whenever a new pair is connected to the Nintendo Switch. The same is true of both Joy-Cons and Pro Controllers, as the acid green/vaporwave pink of my Splatoon 2 Pro Controller is always mirrored in the settings menu of the Nintendo Switch.
Pokémon Sword & Shield are the first entries in the Pokémon series to appear on a home console, which means that this is the first time that the computer in the player's bedroom matches the one that the game is playing on. It's a nice touch that the Joy-Cons in the Pokémon world match the players. We can only wonder if the wonderful scientists who invented all of the technology in the Pokémon universe also managed to fix the Joy-Con drift issue, though, this might be why the player character doesn't take their Nintendo Switch with them.