TLegend* legend = new TLegend(0.5,0.5,0.8,0.8); legend->SetFillColor(kYellow);
TLegend* legend = new TLegend(0.5,0.5,0.8,0.8); legend->SetFillColor(TColor::GetColor("#FF0066"));In this example, we create a TLegend object and set its fill color to a custom color using the GetColor method of the TColor class. The package/library used for TLegend and other ROOT classes is the ROOT framework.