@Override
			public void actionPerformed(ActionContext context) {
				ListingActionContext listingContext = (ListingActionContext) context;

				Color currentColor = service.getBackgroundColor(listingContext.getAddress());
				Color color = service.getColorFromUser(currentColor);
				if (color == null) {
					return;
				}

				Command<DomainObject> command = null;
				ProgramSelection selection = listingContext.getSelection();
				if (selection != null && !selection.isEmpty()) {
					command = new SetColorCommand(color, service, selection);
				}
				else {
					Address address = listingContext.getAddress();
					command = new SetColorCommand(color, service, currentProgram, address);
				}

				tool.execute(command, currentProgram);
			}
A plugin to provider actions for manipulating the colors of the {@link CodeViewerService}.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/colorizer/ColorizingPlugin.java