Use background color rather than hardcoded black color to fill margin

Also fix a bug related to coordinate that preventing margin color to be correctly drawn:

opengl uses a coordinate system with the origin at __lower-left__ corner and positive y-axis __up__, while other parts uses a coordinate system with the origin at __upper-left__ corner and positive y-axis __down__.