graphics.setColor(legendStyle.foregroundColor);
graphics.setBackground(legendStyle.backgroundColor);
graphics.drawRoundRect(round(x), round(y), round(w), round(h), 15, 15);
} else {
graphics.setColor(legendStyle.backgroundColor);
graphics.fillRect(round(x), round(y), round(w), round(h));
graphics.setColor(legendStyle.foregroundColor);
graphics.setBackground(legendStyle.backgroundColor);
graphics.drawRect(round(x), round(y), round(w), round(h));
}