AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Color mixer

Ein Thema von WojTec · begonnen am 27. Dez 2011 · letzter Beitrag vom 17. Aug 2012
Antwort Antwort
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#1

Re: Color mixer

  Alt 28. Dez 2011, 15:34
Hi, thanks!

Float point version working, but: first element in result is first input color, then steps-1 are real steps. Why?

Second int version is making black-white gradient, why?
Angehängte Grafiken
Dateityp: png Bez*tytułu.png (42,5 KB, 49x aufgerufen)
  Mit Zitat antworten Zitat
Iwo Asnet

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

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
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#3

Re: Color mixer

  Alt 28. Dez 2011, 16:01
Thanks, I tried it too, but I forgot about ( and )

And what about BW gradient from int version?
  Mit Zitat antworten Zitat
Furtbichler
(Gast)

n/a Beiträge
 
#4

AW: Re: Color mixer

  Alt 28. Dez 2011, 18:27
And what about BW gradient from int version?
I also...
Zitat:
leave it up to you to find the error yourself.
Hint: It's a copy & paste error in the Blend-Function
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:15 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz