public float check (int color) {
        sum = 0;
        div = 0;

        if (checkRed) {
            div++;
            sum += (color >> 16) & 0xFF;
        }
        if (checkGreen) {
            div++;
            sum += (color >> 8) & 0xFF;
        }
        if (checkBlue) {
            div++;
            sum += color & 0xFF;
        }
        if (checkAlpha) {
            div++;
            sum += (color >> 24) & 0xFF;
        }

        return (sum/div);

    }