How do I set the chart background to a custom color?

 

It's easy with preset colors:


ChartBkg = ChartSetInteger(0, CHART_COLOR_BACKGROUND, White);

ChartBkg = ChartSetInteger(0, CHART_COLOR_BACKGROUND, Lavender);


What about custom colors? Manual selection returns something like 181,230,210. But these don't work:


ChartBkg = ChartSetInteger(0, CHART_COLOR_BACKGROUND, "181,230,210");

ChartBkg = ChartSetInteger(0, CHART_COLOR_BACKGROUND, 181,230,210);
 
whoowl: It's easy with preset colors: What about custom colors? Manual selection returns something like 181,230,210. But these don't work:

Read the documentation: Color Type - Integer Types - Data Types - Language Basics - MQL4 Reference

//--- Literals
C'128,128,128'    // Gray
C'0x00,0x00,0xFF' // Blue
//color names
clrRed            // Red
clrYellow         // Yellow
clrBlack          // Black
//--- Integral representations
0xFFFFFF          // White
16777215          // White
0x008000          // Green
32768             // Green
 
Thank you again!
Reason: