Gnomish Perspective is a Legendary hat unlocked in Plants vs. Zombies: Garden Warfare 2. It is found in a secret room behind that unlocked after the player finds all the Golden Gnomes. When worn, all enemy troops and KO'd ally troops will be a bright blue, and a shader will be applied to the player's vision.
This is an extremely versatile customization in terms of combat use. For all characters, it can emphasize locations of enemies, and may help with aiming. For healers, it will identify revivable allies. Snipers can use it as a tracking device to ensure that they hit an enemy. Especially for Soldiers, who have their Stink Bombs, it can be used as a way to see through smoke screens.
Be warned, however, that certain maps will conflict with Gnomish Perspective and actually hinder your vision. The Great White North is a primary example of this, due to its mostly blue colors. In addition, if you want to wear the hat purely for the cosmetic factor for it, you're out of luck. The display of Gnomish Perspective does not have an option for turning it off.