code: function adobe_rgb_to_lab (cr, cg, cb) {
  	var p = adobe_rgb_to_xyz(cr, cg, cb);
  	var x = p.x, y = p.y, z = p.z;
  
  	var f = [];
  	var r = [];
  
  	r[0] = x / global_white.x;
  	r[1] = y / global_white.y;
  	r[2] = z / global_white.z;
  
  	for (var i = 0; i < 3; i++) {
  		if (r[i] > epsilon) {
  			f[i] = Math.pow(r[i], 1 / 3);
  		} else {
  			f[i] = (kappa * r[i] + 16) / 116;
  		}
  	}
  	var A = 500 * (f[0] - f[1]);
  	var B = 200 * (f[1] - f[2]);
  
  	return {
  		A: A, B: B, y: y
  	};
  }
docs: convert Adobe RGB (1998) with reference white D65 to XYZ