// get the span of each and sort on the component that has the largest span
int spana = box.getAlphaSpan();
int spanr = box.getRedSpan();
int spang = box.getGreenSpan();
int spanb = box.getBlueSpan();
SortComponent sort;
if (spana > spanr && spana > spanb && spana > spang) {
sort = SortComponent.Alpha;
} else if (spanr > spang && spanr > spanb) {
sort = SortComponent.Red;
} else if (spang > spanb) {