Delphi-PRAXiS
Seite 4 von 4   « Erste     234   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Color mixer (https://www.delphipraxis.net/165379-color-mixer.html)

WojTec 17. Aug 2012 13:35

Re: Color mixer
 
Delphi-Quellcode:
var
  RGB: array [0..2] of Byte;
  HSL1, HSL2: array [0..2] of Integer;
  H, S, L: Integer;
begin
  // get values here

  // Max* vars are = 256
  H := Round((MaxHue / ARange) * AValue) * (HSL2[0] - HSL1[0]) shr 8 + HSL1[0];
  S := Round((MaxSat / ARange) * AValue) * (HSL2[1] - HSL1[1]) shr 8 + HSL1[1];
  L := Round((MaxLum / ARange) * AValue) * (HSL2[2] - HSL1[2]) shr 8 + HSL1[2];

  /// set color here
end;

SetLength(A, Round(edtSteps.Value) + 2);
A[0] := Color1;
A[High(A)] := Color2;

N := 255 div (Round(edtSteps.Value) + 1);
X := 0;
Caption := IntToStr(N);
for I := 1 to High(A) - 1 do
begin
  Inc(X, N);
  A[I] := BlendColorsHueCW(Color1, Color2, Byte(X), 255);
end;
F1 :cry:


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:07 Uhr.
Seite 4 von 4   « Erste     234   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz