I'm not sure what you're looking for. Do you want to have the user choose the colors in a dialog? You want it to work for exactly 5 groups or any number of groups? The answer would vary quite a bit depending on the intended use of the add-in.
color1 = RGB Color(100,0,0);
color2 = RGB Color(50,120,50);
color3 = RGB Color(210,0,180);
color4 = RGB Color(130,130,200);
color5 = RGB Color(10,190,70);
Graph Builder(
Size( 754, 490 ),
Show Control Panel( 0 ),
Variables( X( :BoxNo ), Y( :RandomVaules ), Overlay( :BoxNo ) ),
Elements( Box Plot( X, Y, Legend( 4 ), Outliers( 0 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
4,
Properties( 0, {Line Color( -14948892 ), Fill Color( color1 )} ),
Properties( 1, {Line Color( -3636920 ), Fill Color( color2 )} ),
Properties( 2, {Line Color( -5091146 ), Fill Color( color3 )} ),
Properties( 3, {Line Color( -9981603 ), Fill Color( color4 )} ),
Properties( 4, {Line Color( -16744192 ), Fill Color( color5 )} )
)}
)
)
);
-- Cameron Willden