Code for controlling the backlight is from 4JX/L5P-Keyboard-RGB /driver/src directory. Compiled into a DLL for an easy acces from C#.
Bottom and top margin is intended for excluding mostly static elements like the taskbar and window titlebar from influencing the final colour
See 4JX/L5P-Keyboard-RGB for detailed information on supported models.