zzo38computer parent
Is there an environment variable defined for specifying if you want light or dark colours? If so, then it would help with local programs, and also with remote programs (such as this one) if you add a SendEnv command into the SSH configuration file to specify that SSH should use this environment variable.
A little non-portable but there is an xterm escape sequence[1] that gets the user's background color: \e]11;?\a
You might also be able to use the reverse-video[2] escape sequence to get something that works depending on the user's color scheme.