That idea is actually a total myth! The American Kennel Club (AKC) breaks down where this misconception comes from. According to the AKC, "The notion that dogs see only in shades of black and white has been attributed to Will Judy, a lifelong dog fancier, writer, and past publisher of Dog Week magazine... 'It’s likely that all the external world appears to them as varying highlights of black and gray,' Judy wrote in his 1937 manual, Training the Dog." So, while this belief has been around for a long time, science has since proven it wrong.
Dogs can see color, just not in the same way humans do. According to Dogs Naturally, "Your dog’s eyes...only have two cones – blue and yellow. This is called dichromatic vision, and it means that while your dog can still see color, his perception of it is muted compared to a human. The biggest difference is that dogs can’t process red light, which can make it hard for them to distinguish certain colors." Basically, dogs struggle with reds and greens, so anything in that color range might look kind of dull or even like a different shade.