lcHTML = '<HTML><BODY><TABLE><TR>' oForm=createobject('Form') With oForm .ShowTips = .t. lnPerRow = 16 Store 255/(2^3-1) to lnRedInc, lnGreenInc lnBlueInc = 255/(2^2-1) lnShp=0 For blue = 0 to 2^2-1 For green = 0 to 2^3-1 For red = 0 to 2^3-1 lnRed = round(red * lnRedInc,0) lnGreen = round(green * lnGreenInc,0) lnBlue = round(blue * lnBlueInc,0) lnShp = lnShp+1 lcName = 'shp'+trans(lnShp) lcLblName = 'lbl'+trans(lnShp) .addobject(lcName, 'myShape', ; lnShp, lnPerRow, lnRed, lnGreen, lnBlue) lcWebColor = right(trans(rgb(tnBlue,tnGreen,tnRed),'@0'),6) lcHTML = lcHTML + ; iif((lnShp-1)%lnPerRow=0,'</TR><TR>','') + ; '<TD bgcolor=#'+lcWebColor+'>'+lcWebColor+'</TD>' Endfor Endfor Endfor lcHTML = lcHTML+'</TR></TABLE></BODY></HTML>' Strtofile(lcHTML,'256Colors.htm') .SetAll('Visible',.t.) .Height = 20 * 16 .Width = 20 * 16 .Show Endwith Read events Define class myShape as Shape Height = 20 Width = 20 Procedure Init Lparameters tnShp, tnPerRow, tnRed, tnGreen, tnBlue With this .Left = ((tnShp-1)%tnPerRow) * .Width .Top = (ceiling(tnShp/tnPerRow)-1) * .Height .Backcolor = rgb(tnRed, tnGreen, tnBlue) .Tooltiptext = trans(tnRed)+' '+trans(tnGreen)+' '+trans(tnBlue) Endwith Endproc EnddefineCetin