How to use OnClicked for SButton

I created the standalone window plugin and now I am trying to add a button to the tab. I am confused on how to use the OnClicked function correctly. I want change the color to green if the button color is currently red and vice versa. the following code is:

TSharedRef FTaskManagerModule::OnSpawnPluginTab(const FSpawnTabArgs& SpawnTabArgs)
{
	return SNew(SDockTab)
		.TabRole(ETabRole::NomadTab)
		[
			// Put your tab content here!

			SNew(SBox)
			.HAlign(HAlign_Center)
			.VAlign(VAlign_Center)
			[
                 SNew(SButton).ButtonColorAndOpacity(FLinearColor(1.0f, 0.0f, 0.0f, 1.0f)).OnClicked(/*not sure what to do here*/)
			]

		];
}