public Color getColorForLocation(int x, int y) {
		int column;
		if ((!this.getComponentOrientation().isLeftToRight()) &&
			(this instanceof RecentSwatchPanel)) {
			column = numSwatches.width - x / (swatchSize.width + gap.width) - 1;
		}
		else {
			column = x / (swatchSize.width + gap.width);
		}
		int row = y / (swatchSize.height + gap.height);
		return getColorForCell(column, row);
	}
The background color, foreground color, and font are already set to the
defaults from the defaults table before this method is called.
Ghidra/Framework/Docking/src/main/java/docking/options/editor/SettableColorSwatchChooserPanel.java