Do you get divide by zero errors when minRed === maxRed, etc?
If so, it might make more sense to handle that case here, instead of in the getMinimum and getMaximum functions.  Because the special case probably isn't just solid black or solid white, but any solid color.