Alan Quatermain

The Tumblog of one Jim Dovey, iOS Software Chief Architect at Kobo in Toronto, Ontario.
He Twitters, he has an , and can occasionally be found on LinkedIn or Facebook.
If you have a query, you can ask it here.

This blog contains personal opinions, and is not endorsed by any company.

327767497
I really like your glass button blog post, and am trying to copy it. However, I need to put it over a fairly light background at times (almost white), and the default settings don't really look right. I've played around with the RGB colours that were (0.6, 0.6, 0.6) in the default, making them all sorts of other variations, but still not quite happy with it. So I think it will be a combination of changing that, and changing the alpha values. Have you ever come up with a combination that works for a very light background, to save me endless permutations? Thanks.

AskerAnonymous

I’ve not played with it in some time now (although I’ll have a look over the next couple of days). From what I recall, however, the main thing to change would be the alpha values, defined in the array on line 89 of AQGlassButton.m. Essentially, the brighter the background, the lower the alpha values should be. Additionally, you can make the colour itself closer to white to make the shine stand out some more.

Ultimately I think what it will need is a little HDR-style mathematics: each colour in the shine gradient should be a calculated using a multiplicative function of the underlying colour’s brightness, with zero saturation (i.e. greyscale only) and with the range of alpha values spread further apart for higher brightness values (another multiplicative function there then).

I used to work with someone who was a genius at this sort of thing— he would spend his spare time writing purely-mathematical 3D environment generators in 68k/PowerPC assembler, and wrote fantastic realtime anti-aliasing and pattern-rendering algorithms for the Palm III & V series PDAs which rendered faster than the built-in line primitives. Sadly I never had any formal training, so my version involves somewhat more fumbling around in the dark. I’m getting there though…