anchor.diff:  	return vec4(Aw, Nbb, z, n);
   }
   
  -// convert xyz to lab
  -vec4 fwd_xyz2jch(vec4 color) {
  -	vec3 FcN = calc_FcN(1.0);
  -    vec4 DF = calc_DF(D65, 100.0, FcN); 
  -    vec4 ANZn = calc_ANZn(D65, 100.0, 20.0, DF); 
  +// convert color xyz to ciecam jch given viewing conditions xyz_w, La, Yb and S
  +vec4 fwd_xyz2jch(vec4 color, vec3 xyz_w, float La, float Yb, float S) {
  +	vec3 FcN = calc_FcN(S);
  +    vec4 DF = calc_DF(xyz_w, La, FcN); 
  +    vec4 ANZn = calc_ANZn(xyz_w, La, Yb, DF); 
   
   	vec3 xyz = vec3(color);
   	vec3 lms_p = ((xyz * MCAT02) * vec3(DF)) * MHPE;
  
positive.code: 	return vec4(J, C, h, color.a);
  }
   
  // convert lab to xyz
  vec4 rev_jch2xyz(vec4 color) {
  	vec3 FcN = calc_FcN(1.0);
      vec4 DF = calc_DF(D65, 100.0, FcN); 
      vec4 ANZn = calc_ANZn(D65, 100.0, 20.0, DF); 
  
      float J = color.x; float C = color.y; float h_rad = radians(color.z);
      float A = ANZn.x * pow(J / 100.0, 1.0 / FcN.y / ANZn.z);
  
negative.code: 	lch.y = lch.y * (1.0 + u_maxContrast/50.0);														// optionally amp the chroma
  	lch.y = lch.y * u_showColors / 100.0;
  
  	gl_FragColor = rev_jch2rgb(lch, D65, 100.0, 20.0, 1.0);
  }