![]() |
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. |
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 |
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 |
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? |
AW: Proportions of 3 values
Now i got what u mean
Code:
So we have a total summ of
R 100
G 50 B 50
Code:
Now we can calc
100+50+50 = 200
Code:
Hope u get the howto
R 100/200=>50%
G 50/200=>25% B 50/200=>25% |
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:
|
AW: Proportions of 3 values
Never mind, sometimes we get confused by things too simple ;)
|
AW: Proportions of 3 values
Zitat:
|
AW: Proportions of 3 values
Zitat:
|
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 14:38 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