Thema: Delphi Farbauswahl

Einzelnen Beitrag anzeigen

Illuminator-23-5
(Gast)

n/a Beiträge
 
#14

Re: Farbauswahl

  Alt 22. Aug 2003, 10:35
codevorschlag:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
const
  step = 25;
  lines = 1;
var
  r, g, b, x: integer
begin
  PaintBox1.Width := (255 div step)*(255 div step)*(255 div step) mod lines;
  PaintBox1.Height := 5*(lines + 1);
  x := 0;
  for r := 0 to 255 div step do
    for g := 0 to 255 div step do
      for b := 0 to 255 div step do
        with PaintBox1 do begin
          inc(x);
          Canvas.Brush.Color := RGB(r*step, g*step, b*step);
          Canvas.Pen.Color := RGB(r*Step, g*step, b*step);
          Canvas.MoveTo(x mod lines, x div lines);
          Canvas.LineTo(x mod lines, x div lines + 5);
        end;
end;
müsste theoretisch funzen
  Mit Zitat antworten Zitat