# building a gamma function

• Dec 7th 2012, 08:53 AM
rock
building a gamma function
Arggh! I know this should be easy, but after spending 2 hours spinning my wheels, it's time to ask for assistance.

Basically, I want to build a gamma curve covering a specific range of luminosities. (I can find the desired colors associated with those luminosities via my Interactive Color Wheel.)

Input 1: luminosities (L) range from 32 to 73 = 41 range
Input 2: 24 specific colors (c), from 2 to 26 (2 darkest, 26 brightest) = 24 range
Linear: L = 32 + (41 * (c-2)/24)
Goal: boost the dark end so that there are visible differences among the darker colors, but leaving the brightest unchanged

I know that a gamma function is the solution, but I haven't been able to figure out the specific logarithmic and/or exponential magic to get there. (didn't realize I was this rusty :( )

Thanks! -- Rich
• Dec 7th 2012, 10:36 AM
rock
Re: building a gamma function
It might be useful to see exactly what I am trying to do. Look at the small table at the top of the following page:

* HoH: Server View

What you see is incomplete (and incorrect) background coloring for the table cells. My goal is to be able to distinguish a server with just two characters from one with three from one with four, etc. "Beta" is darkest with two characters, and "Infinity" is brightest with 26 characters. (Character count shows when you hover mouse over server name.) Luminosity computed linearly does not achieve the goal.

-- Rich
• Dec 9th 2012, 05:44 AM
rock
Re: building a gamma function
Well, I slogged through it, and got something that works. I don't think it's gamma, but it does what I want.
Code:

```Given:        minChar =  2         maxChar = 26, deltaCC = 24, max change in character count         minLumi = 32         maxLumi = 73, deltaL = 41, max change in luminosity         L = goal Luminosity, cc = character count linearDeltaL = (41 / 24) * (cc - 2) boost = exp(1 - ((cc -2 ) / 24)) L = (linearDeltaL * boost) + 32 cc                                  hexColor  2: L =  0.0 * 2.7  + 32 = 32, c = #092064  3: L =  1.7 * 2.6  + 32 = 36, c = #0a2472  4: L =  3.4 * 2.5  + 32 = 40, c = #0c2980  5: L =  5.1 * 2.4  + 32 = 44, c = #0d2c8a  6: L =  6.8 * 2.3  + 32 = 48, c = #0e3098  7: L =  8.5 * 2.2  + 32 = 51, c = #01359f  9: L = 12.0 * 2.0  + 32 = 56, c = #103cb3 10: L = 13.7 * 1.95 + 32 = 59, c = #1133bb (background color) 11: L = 15.4 * 1.87 + 32 = 61, c = #123dc1 17: L = 25.6 * 1.45 + 32 = 69, c = #1445d9 26: L = 41.0 * 1.0  + 32 = 73, c = #1549e7```
Here is the table: http://r0k.us/rock/junk/smallServerTable.png
The wide top block and the "gone" box are the complement of the background color.