NAME
App::sdif::osx_autocolor
SYNOPSIS
sdif -Mosx_autocolor
DESCRIPTION
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.
Because these options are not defined in this module, user have to define them somewhere.
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.