Thema: Delphi Color mixer

Einzelnen Beitrag anzeigen

Iwo Asnet

Registriert seit: 11. Jun 2011
313 Beiträge
 
#12

AW: Color mixer

  Alt 28. Dez 2011, 15:49
There is a small error in the float-version: If you want 3 steps, you need a delta of 0.5 (0->0.5->1.0), so Delta should be 1/(Steps-1);

Delphi-Quellcode:
Delta := 1/ (Steps-1);
MixRatio := 0;
For i:=0 To Steps-1 do begin
  ColorArray[i] := MixColors(Color1, color2, MixRatio);
  MixRatio := MixRatio + Delta
End;
For question #2 I leave it up to you to find the error yourself (I found it in 5 secs).

Geändert von Iwo Asnet (28. Dez 2011 um 15:51 Uhr)
  Mit Zitat antworten Zitat