This is a module for sdif(1) command to set default option according to terminal background color taken by AppleScript. Terminal brightness is caliculated from terminal background RGB values by next equation.
Y = 0.30 * R + 0.59 * G + 0.11 * B
When the result is greater than 0.5, set --LIGHT_SCREEN option, otherwise set --DARK_SCREEN option. Those are defined as --green and dark-green respectively by default. You can override them in your ~/.sdifrc.
If the environment variable
BRIGHTNESS is defined, its value is used as a brightness rather than caliculated from terminal color. The value of
BRIGHTNESS is in a range of 0 to 100.