AGB  ·  Datenschutz  ·  Impressum  







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

Proportions of 3 values

Ein Thema von WojTec · begonnen am 9. Okt 2010 · letzter Beitrag vom 10. Okt 2010
Antwort Antwort
Seite 1 von 2  1 2      
WojTec

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

Proportions of 3 values

  Alt 9. Okt 2010, 19:51
Delphi-Version: 5
Guys, I have stupid question:

I have color in R, G and B values. I need to know each color element proportion in percent, eg. RGB(0, 255, 0) = 0%, 100% and 0%. Please F1

// Added

I mean how many color element is in color, above RGB(0, 255, 0) mean that color is 100% green, I hope you understand what I mean?

// Added

For example white should be 33% of each element. And sum of all percent values should be 100.

Geändert von WojTec ( 9. Okt 2010 um 20:02 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: Proportions of 3 values

  Alt 9. Okt 2010, 19:58
its mathmatics children learn while they are 10 years old

255 => 100%
0 => 0%

Value / 255 * 100 => Value in Percent
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#3

AW: Proportions of 3 values

  Alt 9. Okt 2010, 20:39
ok, mathmatics for children of 10,5 age

R 255 => 100% / 3
G 255 => 100% / 3
B 255 => 100% / 3

Now u can calc on ur own
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
Satty67

Registriert seit: 24. Feb 2007
Ort: Baden
1.566 Beiträge
 
Delphi 2007 Professional
 
#4

AW: Proportions of 3 values

  Alt 9. Okt 2010, 20:49
...but that kind of calculate the color isnt realy usable.

What does 100% mean?

100% of red, green or blue... or 33% of each color shown as gray?
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#5

AW: Proportions of 3 values

  Alt 9. Okt 2010, 21:31
Now i got what u mean

Code:
R 100
G 50
B 50
So we have a total summ of
Code:
100+50+50 = 200
Now we can calc
Code:
R 100/200=>50%
G 50/200=>25%
B 50/200=>25%
Hope u get the howto
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#6

Re: Proportions of 3 values

  Alt 10. Okt 2010, 10:54
@Sir Rufo, you're of course, my brain was overload yesterday at evening, so I can't invent this simple formula which I learned when I was 10 years old
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#7

AW: Proportions of 3 values

  Alt 10. Okt 2010, 11:46
Never mind, sometimes we get confused by things too simple
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.540 Beiträge
 
Delphi 11 Alexandria
 
#8

AW: Proportions of 3 values

  Alt 10. Okt 2010, 12:10
Never mind, sometimes we get confused by things too simple
Pardon? ()
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#9

AW: Proportions of 3 values

  Alt 10. Okt 2010, 12:16
Never mind, sometimes we get confused by things too simple
Pardon? ()
Manchmal verwirren uns Sachen die zu simpel sind
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.540 Beiträge
 
Delphi 11 Alexandria
 
#10

AW: Proportions of 3 values

  Alt 10. Okt 2010, 12:18
[OT] Soviel Englisch versteh ich auch, ich wollte nur einen Scherz machen [/OT]
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


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 14:12 Uhr.
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