You can change the colors of the background and grid, which you view in the Viewer window. The scene that you view in the Viewer window is always viewed through a camera view (see Camera view). Therefore, the background color depends on which camera you are currently using to view the scene (referred to as the current camera).
You can show or hide the grid of a scene using the Camera settings as well (see Showing the Viewer window grid), but can change the color of the grid only from the Preferences window.
See Camera settings.
To change the background color:
Navigator window A. Current camera selected in Scene browser B. Background Color settings in Camera Settings pane
To change the grid color:
Viewer preference settings