Sign in to follow this  
Hunter_Ex

heeh color problem

Recommended Posts

hey i just wanna get the intensity value of a D3DCOLOR value or COLORREF i tryed intensity = (r+g+b)/3 but it wont work good : ( any help

Share this post


Link to post
Share on other sites
The intensity is the highest value of any color. For example, if you had a color (240, 6, 130) the intensity would be 240. If you had a color (0, 0, 0) the intensity would be 0.

Share this post


Link to post
Share on other sites
(r+g+b)/3 is brightness. If you want to use luminance instead, that's 0.299r + 0.587g + 0.114b. That's supposed to correspond better with what people actually perceive as how bright something is.

Share this post


Link to post
Share on other sites
Quote:
Original post by furby100
(r+g+b)/3 is brightness. If you want to use luminance instead, that's 0.299r + 0.587g + 0.114b. That's supposed to correspond better with what people actually perceive as how bright something is.


I remember reading that people perceive excess blue as brightness. Shouldn't blue have a larger scalar than green in this equation then? Or is that the reason it has the smallest scalar?

Share this post


Link to post
Share on other sites
Quote:
Original post by sordid
Quote:
Original post by furby100
(r+g+b)/3 is brightness. If you want to use luminance instead, that's 0.299r + 0.587g + 0.114b. That's supposed to correspond better with what people actually perceive as how bright something is.


I remember reading that people perceive excess blue as brightness. Shouldn't blue have a larger scalar than green in this equation then? Or is that the reason it has the smallest scalar?


Bringing up two palettes, one for 00FF00 and another for 0000FF (RRGGBB format), I find that green appears to be much brighter for myself. According to that equasion, 00FF00 would have a luminance of 0.587 whereas 0000FF would have a mere 0.114, which seems somewhat plausable to me.

I don't know much about color theory, but I do know that our eyes are most sensitive to different shades of green (between RGB anywyas), which is the reason that the extra bit in 16-bit RGB, if used, is used for green.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this