1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45:
| var f1,f2:Tcolor; colors: Array of Tcolor; startstr,endstr,temp:string; letters,r1,r2,g1,g2,b1,b2,i,rtemp,gtemp,btemp,rstep,gstep,bstep:integer;
colors[0] := f1; temp := colortohtmlcolor(colors[0]); delete(temp,1,1); ecoloredtext.Text := ecoloredtext.Text + '|cff' + temp + startstr[1] +'|r '; rstep := round((r2-r1)/letters-1); gstep := round((g2-g1)/letters-1); bstep := round((b2-b1)/letters-1); if letters = 1 then begin temp := colortohtmlcolor(colors[0]); delete(temp,1,1); ecoloredtext.Text := '|cff' + temp + startstr[1] +'|r '; end else begin For i:=1 to letters-2 do begin rtemp := r1+(rstep*i); if rtemp > 255 then rtemp := 255; if r1=0 then rtemp := 0; gtemp := g1+(gstep*i); if gtemp > 255 then gtemp := 255; if g1=0 then gtemp := 0; btemp := b1+(bstep*i); if btemp > 255 then btemp := 255; if b1=0 then btemp := 0; colors[i] := RGB(rtemp,gtemp,btemp); temp := colortohtmlcolor(colors[i]); delete(temp,1,1); ecoloredtext.Text := ecoloredtext.Text + '|cff' + temp + startstr[i+1] +'|r '; c1.color:=f1; c5.color:=f2; c2.color:=colors[1]; c3.color:=colors[2]; c4.color:=colors[3]; end; temp := colortohtmlcolor(f2); delete(temp,1,1); ecoloredtext.Text := ecoloredtext.Text + '|cff' + temp + startstr[letters] +'|r '; end; except end; |