LordJashin Posted June 6, 2013 Share Posted June 6, 2013 (edited) [scar] function GetSimilarColors(Color, Tol: Integer): TIntArray; var i: Integer; begin for i := 0 to 16777215 do if SimilarColors(Color, i, Tol) then begin SetLength(Result, Length(Result) + 1); Result[Length(Result) - 1] := i; end; end; [/scar] Interesting to see how many colors there is within that Tolerance out of the 16 million. Running: GetSimilarColors(ClRed, 15); The Amount of colors found in each CTS for Running: Original Color (ClRed): CTS0: 4096 CTS1: 2046 CTS2: 22457 CTS3: 163937 Still working out the pictures. Some weird things happen. At 100 Tolerance...some pink shows up And here's a TON of colors debugged Pretty much the entire 16 million. If you use your color picker on it, gets some crazyness. Switched: Edited June 6, 2013 by LordJashin Quote Link to comment Share on other sites More sharing options...
FHannes Posted June 6, 2013 Share Posted June 6, 2013 These results don't really tell you much... The point of CTS2/3 is to provide a more accurate result at lower tolerance values, at the cost of additional cpu cycles. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted June 6, 2013 Author Share Posted June 6, 2013 (edited) I added pictures. Lol looks like there's a bit of orange in the CTS(2) one. Edit: Weird there must be some sort of error in my code for the bitmaps...get weird things at high tols. Edited June 6, 2013 by LordJashin Quote Link to comment Share on other sites More sharing options...
slacky Posted June 7, 2013 Share Posted June 7, 2013 (edited) I added pictures. Lol looks like there's a bit of orange in the CTS(2) one. Edit: Weird there must be some sort of error in my code for the bitmaps...get weird things at high tols. if you are refering to the following sentence: ...And here's a TON of colors debugged Pretty much the entire 16 million. If you use your color picker on it, gets some crazyness. That might be cause you scale in bitshisted RGB/RGBInt. It could would give a clean(er) result (for RGB) if you do a 3x loops (nested), and use RGB, and convert it to RGBInt, never tested. EG (result might be wierd as well): base := 0; for A to 255 do begin for B to 255 do begin for C to 255 do begin color := RGBtoColor(R,G,B); if SimilarColors(base, color, tol) then begin SetLength(Result, Length(Result) + 1); Result[High(Result)] := i; end; end; end; end; Edited September 4, 2013 by slacky Quote Link to comment Share on other sites More sharing options...
LordJashin Posted June 7, 2013 Author Share Posted June 7, 2013 Well for the 16 million colors thing. I did something similar to this: (Note I'm using ur RGB stuff in it now) Check out the Code on the right...am i doing anything wrong? Quote Link to comment Share on other sites More sharing options...