Oh craps, everyone's beaten me to it... my offering...
OutputByte=(InputByte-165)*318/100
This is calculated from...
245-165=80 (the original span)
254/80=3.175 (new span divided by old span)
3.175 is rounded up to 3.18 and then we multiply it by 100 so as to keep everything an integer (which is why we finally do a divide by 100 to bring us back to reality).
You may want to preceed the formula with...
If InputByte<165 then InputByte=165
If InputByte>245 then InputByte=245
OMG Darrel... How much have you had to drink to think of that one?
Bookmarks