public static int minkowskiDist(int color1, int color2, double k) {

        double p = k;
        // use p >= 1 we have the Minkowski inequality
        // careful : the higher the power, the longer the wait

        double dRed = Math.abs( ((color1 & RED_MASK) >> 16) - ((color2 & RED_MASK) >> 16));
        double dGreen = Math.abs( ((color1 & GREEN_MASK) >> 8) - ((color2 & GREEN_MASK) >> 8));
        double dBlue = Math.abs( (color1 & BLUE_MASK) - (color2 & BLUE_MASK));

        int dist = (int)Math.pow(Math.pow(dRed,p) + Math.pow(dGreen,p) + Math.pow(dBlue,p), 1/p);

        return dist;

    }