SetClassNameGenerator in Grid

Hi guys, How can I change the background color of a selected grid item? When I do:
grid.addSelectionListener (event → {// I would like to change the background of the selected item}).
Can anyone give me some advice?