private void createActions() {
		//
		// Color Changing
		//

		String group = "ZClear";
		int subgroup = 1;

		HelpLocation helpLocation = new HelpLocation("CodeBrowserPlugin", "Listing_Background");

		// set color action
		DockingAction setColorAction = new DockingAction("Set Color", getName()) {
			@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);
			}

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ListingActionContext)) {
					return false;
				}
				return true;
			}
		};
		setColorAction.setPopupMenuData(new MenuData(new String[] { MENU_PULLRIGHT, "Set Color" },
			null, group, MenuData.NO_MNEMONIC, Integer.toString(subgroup++)));
		setColorAction.setHelpLocation(helpLocation);

		// clear action
		DockingAction clearAction = new DockingAction("Clear Color", getName()) {
			@Override
			public void actionPerformed(ActionContext context) {
				ListingActionContext listingContext = (ListingActionContext) context;
				AddressSetView selection = listingContext.getSelection();
				if (selection == null || selection.isEmpty()) {
					AddressSet set = new AddressSet();
					set.add(listingContext.getAddress());
					selection = set;
				}
				ClearColorCommand command = new ClearColorCommand(service, selection);
				tool.execute(command, currentProgram);
			}

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ListingActionContext)) {
					return false;
				}

				ListingActionContext listingContext = (ListingActionContext) context;
				ProgramSelection selection = listingContext.getSelection();
				if (selection != null && !selection.isEmpty()) {
					return isColored(selection);
				}
				return isColored(listingContext.getAddress());
			}
		};
		clearAction.setPopupMenuData(new MenuData(new String[] { MENU_PULLRIGHT, "Clear Color" },
			null, group, MenuData.NO_MNEMONIC, Integer.toString(subgroup++)));
		clearAction.setHelpLocation(helpLocation);

		// clear all action
		DockingAction clearAllAction = new DockingAction("Clear All Colors", getName()) {
			@Override
			public void actionPerformed(ActionContext context) {
				ClearColorCommand command = new ClearColorCommand(service);
				tool.execute(command, currentProgram);
			}

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ListingActionContext)) {
					return false;
				}

				AddressSetView set = service.getAllBackgroundColorAddresses();
				return !set.isEmpty();
			}
		};
		clearAllAction
				.setPopupMenuData(new MenuData(new String[] { MENU_PULLRIGHT, "Clear All Colors" },
					null, group, MenuData.NO_MNEMONIC, Integer.toString(subgroup++)));
		clearAllAction.setHelpLocation(helpLocation);

		//
		// Navigation
		//

		// next color range start
		nextAction = new NextColorRangeAction(this, tool, navOptions);

		// previous color range start
		previousAction = new PreviousColorRangeAction(this, tool, navOptions);

		tool.addAction(clearAction);
		tool.addAction(clearAllAction);
		tool.addAction(setColorAction);
		tool.addAction(nextAction);
		tool.addAction(previousAction);
	}
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