int ir,ig,ib,index; double r,g,b; /* r,b,g colour [0,1] */ int n=6; /* Number of samples */ for (ib=0;ib