Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Proportions of 3 values (https://www.delphipraxis.net/155122-proportions-3-values.html)

WojTec 9. Okt 2010 19:51

Delphi-Version: 5

Proportions of 3 values
 
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 :sad:

// 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.

Sir Rufo 9. Okt 2010 19:58

AW: Proportions of 3 values
 
its mathmatics children learn while they are 10 years old

255 => 100%
0 => 0%

Value / 255 * 100 => Value in Percent

Sir Rufo 9. Okt 2010 20:39

AW: Proportions of 3 values
 
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

Satty67 9. Okt 2010 20:49

AW: Proportions of 3 values
 
...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?

Sir Rufo 9. Okt 2010 21:31

AW: Proportions of 3 values
 
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

WojTec 10. Okt 2010 10:54

Re: Proportions of 3 values
 
@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 :lol:

Sir Rufo 10. Okt 2010 11:46

AW: Proportions of 3 values
 
Never mind, sometimes we get confused by things too simple ;)

DeddyH 10. Okt 2010 12:10

AW: Proportions of 3 values
 
Zitat:

Zitat von Sir Rufo (Beitrag 1054799)
Never mind, sometimes we get confused by things too simple ;)

Pardon? :gruebel: (:duck:)

Sir Rufo 10. Okt 2010 12:16

AW: Proportions of 3 values
 
Zitat:

Zitat von DeddyH (Beitrag 1054807)
Zitat:

Zitat von Sir Rufo (Beitrag 1054799)
Never mind, sometimes we get confused by things too simple ;)

Pardon? :gruebel: (:duck:)

Manchmal verwirren uns Sachen die zu simpel sind

DeddyH 10. Okt 2010 12:18

AW: Proportions of 3 values
 
[OT] Soviel Englisch versteh ich auch, ich wollte nur einen Scherz machen :zwinker: [/OT]


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:00 Uhr.
Seite 1 von 2  1 2      

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