ID:154207
 
Does anyone know how to find the perceptual brightness of an RGB color? I've been searching the net, but most sites don't bother with any formulae. The ones that do, are a bit over my head and I really don't feel like studying so much color theory for a simple proc that isn't pivotal to my game.
I would love to help you....

but I can't lol. This would be very useful for me to. Asusming that your RGB proc sometimes leaves icons too bright.
Shadowdarke wrote:
Does anyone know how to find the perceptual brightness of an RGB color? I've been searching the net, but most sites don't bother with any formulae. The ones that do, are a bit over my head and I really don't feel like studying so much color theory for a simple proc that isn't pivotal to my game.

I do know that lime green 0,255,0 appears to be the brightest colour, followed by bright red 255,0,0 , followed by full blue 0,0,255. I don't know individual combinations -- I usually just eyeball them.

I'm guessing, in your case, you want to have a minimum and maximum brightness level for users' custom colour selections using the rgb() proc. (For Darke Dungeon? Please say it is! =))

My advice would be to set up a large variety of colours yourself and only allow people to select from those. The best hexadecimals that you can use are the following:

00, 33, 66, 99, CC, FF

and their decimal counterparts:

0, 51, 102, 153, 204, 255

These are almost guaranteed to look different for every colour.

Thus, CCCCFF will look very different from 99CCFF when the two are compared. It's possible to make a mistake if you're making a very quick glance, but otherwise the differences are notable enough not to cause problems.
In response to Spuzzum
Spuzzum wrote:

I do know that lime green 0,255,0 appears to be the brightest colour, followed by bright red 255,0,0 , followed by full blue 0,0,255. I don't know individual combinations -- I usually just eyeball them.

The problem comes when including mixed colors. Magenta (<font color=#FF00FF>#FF00FF</font>) should register about the same as red (<font color=#FF0000>#FF0000</font>). I can't just use the max of the 3 color components, because then pale yellow (<font color=#FFFF99>#FFFF99</font>) will be the same as yellow (<font color=#FFFF00>#FFFF00</font>) or even blue (<font color=#0000FF>#0000FF</font>), which as you noted looks darker than other FF level colors.

Maybe I could average the max and min values of the RGB value set, and weight it slightly so that green is worth more than red which in turn is worth more than blue. White would be 255. Magenta, red, blue, green, yellow, and cyan would be around 128. Pale yellow would be 204.

Now the trouble comes when the mid range value is different. Are <font color=#FFCC99>#FFCC99</font> and <font color=#FF99CC>#FF99CC</font> close enough in brightness to count the same? I guess that depends on the amount I weight red versus green versus blue.

I'm guessing, in your case, you want to have a minimum and maximum brightness level for users' custom colour selections using the rgb() proc. (For Darke Dungeon? Please say it is! =))

Yes, that's the reason. It's not for DD though. I got a touch of Spuzzitis and started another project that I'm going to keep quiet for a while. Any color manipulations I work out for this project will certainly improve the quality of Darke Dungeon though. ;)

My advice would be to set up a large variety of colours yourself and only allow people to select from those. The best hexadecimals that you can use are the following:

00, 33, 66, 99, CC, FF

I agree. Offsets of of 33 hex make very good distinctions between colors. Right now the system is based on 11 hex giving 16 degrees of color for each component, but if it proves a problem I'll probably change it to 33 hex. 33 still provides plenty of variety with less chance of color confusion.
In response to Shadowdarke
Wow.All I have to say is that you guys are good at colors.Wow.

-Kappa the Imp
Shadowdarke wrote:
Does anyone know how to find the perceptual brightness of an RGB color? I've been searching the net, but most sites don't bother with any formulae. The ones that do, are a bit over my head and I really don't feel like studying so much color theory for a simple proc that isn't pivotal to my game.

Probably the simplest calculation is what you'd use for grayscale:
gray = round((r*30 + g*59 + b*11)/100,1)

Lummox JR