' 'Returns the index of the closest color to 'the given RGB value. ' 'Parameters: ' R - The Red component of the desired color ' G - The green component ' B - The blue component ' C - The number of colors on screen - 1 ' Procedure _CLOSEST[R,G,B,C] CL=10000000 CLC=-1 For Z=0 To C RC=(Colour(Z)/256) RD=(R-RC)*(R-RC) GC=(Colour(Z)/16) and 15 GD=(G-GC)*(G-GC) BC=Colour(Z) and 15 BD=(B-BC)*(B-BC) A=RD+GD+BD If A