|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Is one color brighter than the other one?Hello!
In my application (it's a very graphic related application for children) the user can set the colors of the buttons by himself. The user can set two colors which will fade into each other from top to bottom. My initial idea was that the upper color should be brighter than the lower color, as you can see it all controls from MS. But most people do not know or get it, and the always switch the colors, and the buttons look like they're pressed (pressed buttons have their darker color on top and the brighter color on bottom, while it is just the other way around in their "normal" state). Now I am trying to automatically switch it if it's wrong. Does anybody know if it's possible to say if one color is brighter than the other one? Ulf "Ulf Christenson" <u.christen***@googlemail.com> a écrit dans le message de news: %23s%23jkFkoJHA.3***@TK2MSFTNGP05.phx.gbl...Show quoteHide quote > Hello! Off the top of my head I would suggest comparing the sum of their RGB > > In my application (it's a very graphic related application for children) > the user can set the colors of the buttons by himself. > The user can set two colors which will fade into each other from top to > bottom. My initial idea was that the upper color should be brighter than > the lower color, as you can see it all controls from MS. > But most people do not know or get it, and the always switch the colors, > and the buttons look like they're pressed (pressed buttons have their > darker color on top and the brighter color on bottom, while it is just the > other way around in their "normal" state). > Now I am trying to automatically switch it if it's wrong. > Does anybody know if it's possible to say if one color is brighter than > the other one? > > Ulf components. Ulf Christenson wrote:
> Hello! It's somewhat subjective, but much less so if you're comparing two> > Does anybody know if it's possible to say if one color > is brighter than the other one? shades of the same basic color. Assuming you have the BGR values for the two colors: Luma& = (B * 11&) + (G * 59&) + (R * 30&) Whichever color has the higher Luma value is brighter. This is a shorthand way of getting the 'standard' luminance value. You'll find different sets of weightings for different color systems and schemes, but this one (NTSC) works just fine. I use:
Public Function ColorApparentBrightness(nColor As Long) As Long Dim iR As Long Dim iG As Long Dim iB As Long iR = nColor And 255 iG = (nColor \ 256) And 255 iB = (nColor \ 65536) And 255 ColorApparentBrightness = iR * 0.2126 + iG * 0.7152 + iB * 0.0722 End Function Show quoteHide quote "Ulf Christenson" <u.christen***@googlemail.com> escribió en el mensaje news:%23s%23jkFkoJHA.3572@TK2MSFTNGP05.phx.gbl... > Hello! > > In my application (it's a very graphic related application for children) > the user can set the colors of the buttons by himself. > The user can set two colors which will fade into each other from top to > bottom. My initial idea was that the upper color should be brighter than > the lower color, as you can see it all controls from MS. > But most people do not know or get it, and the always switch the colors, > and the buttons look like they're pressed (pressed buttons have their > darker color on top and the brighter color on bottom, while it is just the > other way around in their "normal" state). > Now I am trying to automatically switch it if it's wrong. > Does anybody know if it's possible to say if one color is brighter than > the other one? > > Ulf "Eduardo" <m*@mm.com> wrote in message news:gp8kje$2ra$1@aioe.org...
http://en.wikipedia.org/wiki/Luminance_(relative)> ColorApparentBrightness = iR * 0.2126 + iG * 0.7152 + iB * 0.0722 > In my application (it's a very graphic related application for children) I wonder about that assumption. I know you didn't> the user can set the colors of the buttons by himself. > The user can set two colors which will fade into each other from top to > bottom. My initial idea was that the upper color should be brighter than > the lower color, as you can see it all controls from MS. > But most people do not know or get it, and the always switch the colors, > and the buttons look like they're pressed (pressed buttons have their > darker color on top and the brighter color on bottom, while it is just > the other way around in their "normal" state). > Now I am trying to automatically switch it if it's wrong. ask for opinions about it, but you describe a creative graphic program for children. Shouldn't they be able to do it "wrong" and discover for themselves the aesthetics of color? Maybe they'll prefer the bottom-lit effect. (A 6 year old boy might prefer to have his GUI look vaguely sinister, like an alien spaceship console.) Or maybe after a couple of days they'll decide they don't like that look and will reverse the colors, having learned something about how 3-d simulation works, and/or having grokked a bit more about the emotional/vibrational effects of colors. ...Just a thought. I don't know from your description what purpose the program is intended to serve. Show quoteHide quote > Does anybody know if it's possible to say if one color is brighter than > the other one? > > Ulf
PaintPicture
My concept for a very basic stripboard layouter in VB6 Put Date/Time on Right Side of Form.Caption With .... End With - Speed Days and Years - Data Comparing ActiveX Control Crashes - VB6 Procedure limit for Form? config file Copy protection and license management programs Need a Friend, Maybe |
|||||||||||||||||||||||