From: Jeff Ciaccio on
I would like to get the total rgb value, but this does not seem to work.
Can anybody help me find the values as integers?

playerRGB = (Me.BackColor.Red + Me.BackColor.Green + Me.BackColor.Blue)


Thanks
--
Jeff Ciaccio
Physics and AP Physics Teacher
Sprayberry High School; Marietta, GA
Blog: http://sprayberry.typepad.com/ciaccio

From: Armin Zingler on
"Jeff Ciaccio" <noname(a)noreply.org> schrieb
> I would like to get the total rgb value, but this does not seem to
> work. Can anybody help me find the values as integers?
>
> playerRGB = (Me.BackColor.Red + Me.BackColor.Green +
> Me.BackColor.Blue)

"Does not work" is always not very specific. If the compiler does not throw
an error, you should enable Option Strict first. If it does, replace Red
with R, Green with G and Blue with B.




Armin

From: Göran Andersson on
Jeff Ciaccio wrote:
> I would like to get the total rgb value, but this does not seem to work.
> Can anybody help me find the values as integers?
>
> playerRGB = (Me.BackColor.Red + Me.BackColor.Green + Me.BackColor.Blue)
>
>
> Thanks

The Red, Green and Blue properties are color constants. You want to use
the R, G and B properties to get the color component values.

What is it that you are trying to do? Just adding the color component
values doesn't seem very useful. Perhaps it's the ToArgb method that you
are looking for?

--
G�ran Andersson
_____
http://www.guffa.com
From: Jeff Ciaccio on
I do not want to let the user make the screen too dark (because the font
color is black), and I think that happens when the sum of R + G + B is a low
value, 0 being completely black.

I'm not familiar with the ToArgb method - does it do something similar?

Thanks!
Jeff

From: Göran Andersson on
Jeff Ciaccio wrote:
> I do not want to let the user make the screen too dark (because the font
> color is black), and I think that happens when the sum of R + G + B is a
> low value, 0 being completely black.

I see. What you want is the GetBrightness() method of the Color class.
It returns a float value between 0.0 and 1.0.

> I'm not familiar with the ToArgb method - does it do something similar?

No, it returns the color as an integer value, where the alpha, red,
green and blue values are stored sequentially in the bits of the integer.

--
G�ran Andersson
_____
http://www.guffa.com