代码


if(typeof f_c=="undefined"){f_c=function(x,y,px,py,r){return Math.sqrt(Math.pow(x-px,2)+Math.pow(y-py,2))<=r;}}

var x0=x-512,y0=512-y;
r=g=b=127;

if(f_c(x0,y0,0,0,256)){r=g=b=(x0>0)?0:255;}

if(f_c(x0,y0,0,128,128)&&x0>0){r=g=b=255;}
if(f_c(x0,y0,0,-128,128)&&x0<=0){r=g=b=0;}

if(f_c(x0,y0,0,128,32)){r=g=b=0;}
if(f_c(x0,y0,0,-128,32)){r=g=b=255;}