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: }
  
  void main( void ) {
  	vec4 lch = fwd_rgb2jch(texture2D(u_tex0, v_uv), D65, 100.0, 20.0, 1.0);
  
  	if (u_numEdges > 9.0) {					// u_numEdges 0 = no edges, 10 = 1 edge, 20 = 2 edges, 30 = 3 edges, etc.
  		float dx = 1000.0 / (u_numEdges);		// dx is width of grey bands 100 for 1 edge, 50 for 2 edges, 33 for 3 edges, 25 for 4 edges, etc
  