@Override
    public int compare(final ColorCount c1, final ColorCount c2) {
        switch (colorComponent) {
        case ALPHA:
            return c1.alpha - c2.alpha;
        case RED:
            return c1.red - c2.red;
        case GREEN:
            return c1.green - c2.green;
        case BLUE:
            return c1.blue - c2.blue;
        default:
            return 0;
        }
    }
Constructs a new instance.

@param colorComponent Color component to wrap.
src/main/java/org/apache/commons/imaging/palette/ColorCountComparator.java