Jump to content
  • Advertisement
Sign in to follow this  
Hunter_Ex

heeh color problem

This topic is 4712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!