For example, how can I make a minor mode that changes the default foreground color to gray, and upon exiting the minor mode, the foreground color is back to black? This mode might be useful when you don't like certain text to be seen over your shoulders.
For now, I run the following code to turn text color to gray:
(set-face-attribute 'default (selected-frame) :foreground "darkgrey")
And the following code to get back.
(set-face-attribute 'default (selected-frame) :foreground "SystemWindowText")
But this affects all buffers.