public static double[] getLightnessAndSaturation(int color) {
		double var_R = ( color >> 16 & 0xff ) / 255.0;                   //RGB from 0 to 255
		double var_G = ( color >> 8 & 0xff ) / 255.0;
		double var_B = ( color & 0xff ) / 255.0;

		double var_Min = Math.min(Math.min( var_R, var_G), var_B );    //Min. value of RGB
		double var_Max = Math.max(Math.max( var_R, var_G), var_B );      //Max. value of RGB
		double del_Max = var_Max - var_Min;
		
		double l = ( var_Max + var_Min ) / 2.0;
		
		double s;
		if ( del_Max == 0 ) {
			s = 0.0;
		}
		else {
			if ( l < 0.5 ) s = del_Max / (var_Max + var_Min );
			else 			s = del_Max / (2.0 - var_Max - var_Min);
		}
		
		double[] result = {l, s};
		return result;
	}