Please refer to Note 1 in this article:
https://www.originlab.com/www/support/resultstech.aspx?ID=647&language=English.
The below example shows how to set the background color to a custom color. I hope you will find it useful.
void test5270()
{
GraphLayer gl = Project.ActiveLayer();
if ( !gl.IsValid() ) return;
int r = 0, g = 255, b = 128;
TreeNode tr = gl.Background.Color;
if ( tr.IsValid() )
{
tr.nVal = r + 256*g + 65536*b + 16777216;
gl.Background.Color = tr;
}
}
Deanna
OriginLab Technical Services