I know I'm a late to this discussion but I thought I would post my attempt to this thread just in case it is useful/interesting to anyone.
GLSL
vec3 xy2rgb3( in vec2 pos ) {<br>
vec2 rc = pos * 8.0;<br>0;
vec2 mp = fract( rc );<br>;
rc = (rc - mp) * 0.125;<br>125;
return vec3( (rc.y * 0.125) + rc.x, mp );<br>;
}
The live editable version can be found here xy2rgb3/rgb3toxy2.