>CREATE CURSOR AAA(COULEUR I,COULEURTEXT C(11)) && !! fixed width of field from 6 to 11 > >* prepare base (rainbow) colors >* note that we skip the 0 and 32 brightness to do not show RGB(0,0,0) and RGB(255,255,255 >* in all 24 columns in the first row >for Hue = 1 to BaseColours > for Lum = 1 to Brightnesses - 1 > nColor = HLStoRGB( (Hue-1)*(HLSMAX/BaseColours ), Lum*(HLSMAX/Brightnesses ),; > HLSMAX-abs(Lum*(HLSMAX/Brightnesses)*2 - HLSMAX)) > aC[Lum, Hue] = nColor > aN[Lum, Hue] = allt(str(nColor % 256)) + "," + ; > allt(str(int(nColor/256) % 256)) + "," + allt(str(int(nColor/65536) % 256)) >INSERT INTO AAA (COULEUR,COULEURTEXT) VALUES (aC[Lum, Hue],aN[Lum, Hue]) > endfor >endfor >* prepare other (shadow) colors >for Sat = BaseColours+1 to BaseColours + ShadowColours > for Lum = 1 to Brightnesses - 1 > nColor = HLStoRGB( (Sat-BaseColours-1)*(HLSMAX/ShadowColours ),; > Lum*(HLSMAX/Brightnesses ), abs(Lum*(HLSMAX/Brightnesses )*2 - HLSMAX)) > aC[Lum, Sat] = nColor > aN[Lum, Sat] = allt(str(nColor % 256)) + "," + ; > allt(str(int(nColor/256) % 256)) + "," + allt(str(int(nColor/65536) % 256)) >INSERT INTO AAA (COULEUR,COULEURTEXT) VALUES (aC[Lum, Sat],aN[Lum, Sat]) && !! use "Sat" instead of "Hue" as index for second dimention of arrays > endfor >endfor >* prepare greyscale colors. Note the difference - to show black and white colours we >* divide brightness by another way >for Lum = 1 to Brightnesses - 1 > nColor = min((Lum-1) * (256/(Brightnesses-2)),255) > nColor = RGB(nColor,nColor,nColor) > aC[Lum, BaseColours+ShadowColours+1] = nColor > aN[Lum, BaseColours+ShadowColours+1] = allt(str(nColor % 256)) + "," + ; > allt(str(int(nColor/256) % 256)) + "," + allt(str(int(nColor/65536) % 256)) >INSERT INTO AAA (COULEUR,COULEURTEXT) VALUES; > (aC[Lum, BaseColours+ShadowColours+1],aN[Lum, BaseColours+ShadowColours+1]) >endfor > >BROWSE >