Hacked (yes really).
August 2nd, 2009
Hey readers - I want to apologize to anyone who tried to get to my last post and got a bunch of spam for cheap foreign pharmaceuticals instead. That certainly wasn't my intention (when I sell out, it won't be for gasex pills) and I'm taking steps to guard against this sort of thing in the future. If you want specifics on the hack, the best thread I've seen so far is here.
Sincerely,
-Rob
Moved & Mangled
December 3rd, 2008
I got up the gumption to move the site last night and it seems to have been (for the most part?) successful! First off my apologies to anyone inconvenienced – I'm trying to clean up my file structure so a lot of stuff is still in flux. Secondly, it seems as though my encoding has gone all pear-shaped and changed non-roman glyphs into ASCII-soup. I'm working on both issues and hope to have things running smoothly in a couple of days. If you need a class or formula urgently, please give me a shout at rob@hattv.com.
Now the good news; My new host runs entirely on wind power and my out of pocket expense is a quarter of what I used to pay. Huzzah!
16bit Gradients in Flash – Almost.
August 3rd, 2008
A forum thread recently challenged my knowledge (and preconceptions) of gradients in Flash. I’ve always worked under the assumption that Flash uses 8 bits per color channel – zero to 0xFF for R, G, and B – end of story. Although this is generally considered the shallow end of the color-depth pool, it’s always been more or less sufficient. The shallow color depth has long been considered the sweet spot between passable (even realistic) color recreation, and the exponential processing lode of adding more data to each pixel in a display.
The point where 8-bit graphics break down is when it comes time to interpolate a gradient. If you want to draw a smooth fade from black to 10% grey, you want as many colors in-between as there are pixels. In an 8-bit environment, you’ve only got about 26 shades of grey to work with so anything bigger than 26 pixels across is going to have blocks of pixels, all colored the same – in the biz, this is called “banding.”

Interestingly, while Flash is bound to 8-bit it will still import a 16-bit Tiff. When I realized this I figured there must be some trickery going on - either I could use 16-bit color in Flash or else the Tiff was getting the chop. Unfortunately, it turns out Flash downsamples the image into it's own color profile, but the importer is good enough to give us the courtesy of a good dithering first (provided you enabled it in Photoshop). Here’s a little demo to show the dithering - if you squint you can see the banding on the originals.
Edit: Per Ben’s comment, I’ve tweaked the colors below to make the banding a little more noticeable (if you still see flat-black bars, try cranking up your monitor’s brightness/contrast). For all the headaches I’ve had from gradients in the past, making a bad one is really hard to reproduce on command!
[sad excuse for not posting goes here]
July 20th, 2008
A few weeks ago now, I got a comment on my last post asking for the source. The real (dirty little) reason I took so long on this, is that I was trying to find some time to rewrite this stuff and post a much better version alongside, but it just didn't happen. I’d still like to get a new version of this thing put together – I’m confident I can beat that 11 second benchmark – but in the meantime, anyone reading can take a chuckle at my schlocky earlier version. And for the curious, here’s a link back to what I originally developed that code for - which is a roundabout apology/defense of my (very) liberal memory hogging.
Maze pathfinder [1mb]
The jump to AS3
May 26th, 2007
From here on out I’m going to be working in ActionScript 3 and hopefully posting a lot more of my code tests.
