private List<ColorValueNode> organizeByIdRefs(List<ColorValueNode> nodes) {
			List<ColorValueNode> results = new ArrayList<>();

			Map<String, ColorValueNode> idMap = new HashMap<>();
			for (ColorValueNode node : nodes) {
				idMap.put(node.getId(), node);
			}
			for (ColorValueNode colorNode : nodes) {
				if (colorNode.isIndirect()) {
					String refId = colorNode.getReferenceId();
					ColorValueNode parent = idMap.get(refId);
					if (parent == null) {
						// this implies the user has changed id names and refreshed the tool
						continue;
					}
					parent.addNode(colorNode);
				}
				else {
					results.add(colorNode);
				}
			}
			return results;
		}
Tree for showing colors organized by similar colors and reference relationships. This was
built as a developer aid to help consolidate similar colors in Ghidra. This may be removed
at any time.
Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeColorTree.java