termbg is pretty great and easy to use / test via cargo run.
However, I noticed that when using macOS Terminal.app, with the default profile ("Basic"), the results are incorrect.
It seems that termbg (or one of its dependencies) does not take into account the macOS systemwide appearance, which changes the color of the default terminal from white (Light mode) to black (Dark mode). This setting may change at any time, and can be fetched with:
$ defaults read -globalDomain AppleInterfaceStyle
# prints "Dark" or nothing
Note that this is the ONLY Terminal.app Profile which behaves this way (AFAIK).
Examples

