void RGB2LAB(int sR, int sG, int sB, double[] labVal) {
        //------------------------
        // sRGB to XYZ conversion
        //------------------------
    	double[] XYZ = new double[3]; 
        RGB2XYZ(sR, sG, sB, XYZ);
        
        //------------------------
        // XYZ to LAB conversion
        //------------------------
        double epsilon =  0.008856;	//actual CIE standard
        double kappa = 903.3;		//actual CIE standard
        
        double Xr = 0.950456;	//reference white
        double Yr = 1.0;        //reference white
        double Zr = 1.088754;	//reference white
        
        double xr = XYZ[0]/Xr;
        double yr = XYZ[1]/Yr;
        double zr = XYZ[2]/Zr;

        double fx, fy, fz;
        if (xr > epsilon) {
            fx = Math.pow(xr, 1.0/3.0);
        } else {
            fx = (kappa*xr+16.0)/116.0;
        }
        if (yr > epsilon) {
            fy = Math.pow(yr, 1.0/3.0);
        } else {
            fy = (kappa*yr+16.0)/116.0;
        }
        if (zr > epsilon) {
            fz = Math.pow(zr, 1.0/3.0);
        } else {	
            fz = (kappa*zr+16.0)/116.0;
        }

        labVal[0] = 116.0*fx-16.0;
        labVal[1] = 500.0*(fx-fy);
        labVal[2] = 200.0*(fy-fz);
    }