Autor Beitrag
spike0
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Mi 04.05.05 18:19 
Wie kann ich die Helligkeit, Sättigung und Farbton von einer Farbe herausfinden?

Ich habe schon 2 verschiedene Methoden gefunden, wie ich es mache, aber beide funktionieren nicht: Ich nehme den TColorDialog, merke mir dort die HSV werte einer Farbe und die stimmen dann nicht mit den, die die Funktion rausbekommt.

Weiß jemand, wie es geht?
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mi 04.05.05 18:37 
=> Forensuche (Suche in: Delphi-Forum, Delphi-Library HSV)!
Ich hab irgendwo die Funktionen RGB2HSV und RGB2HLS gepostet.
spike0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Mi 04.05.05 18:39 
Also jetzt verstehe ich nix mehr...

Bei TColorDialog gehen die HSV-Werte bis 240, bei den Quelltexten sind die sehr unterschiedlich:

TColorDialog:
H 239
S 240
V 240

Funkrion1:
H 360
S 255
V 255

Funktion2:
H 255
S 255
V 255
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mi 04.05.05 18:41 
... Um welche Farbe handelt es sich denn? Ich kann dir die korrekten Umrechnungen geben.
spike0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Mi 04.05.05 18:53 
Ich habe das in der Suche nicht gefunden.

Ich mache das nicht für eine konkrete Farbe, also hier ein BSP.:

Ich öffte den TColordialog und nehme die Frabe rgb(10,70,70). Daneben stehen ja die HSV Werte(hsv(120,180,38))

Mit einer Funktion bekomme ich aber hsv(0,255,15) raus, all die anderen funktionieren genauso wenig...
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 04.05.05 18:57 
Hast'de mal gekuckt ob dsa resultat der Farbmischung vielleicht gleich ist? :gruebel:
spike0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Mi 04.05.05 19:04 
Na gut, ich glaube ich habe es raus...

Danke für die Hilfe :)