Wednesday, January 7th, 2009

Archive for the ‘General’ category

Further adventures in colorspaces

Update: Here's a slightly modified version of the colorspace adventure! In this iteration, you can also adjust sliders for R, G, and B. Regardless of which "space" you make changes to, the other space will update accordingly:

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

If you read my last entry, you know I'm in the process of reinventing the wheel! I mean creating a color picker.

In preparation, I did some additional research on the HSV colorspace. The Wikipedia article contains all kinds of totally awesome math stuff -- some of which I actually understand! (I also found another site that, while replete with pictures and explanations, etc., left me scratching my head, though I think if I read through it again, I could figure it out...)

Anyway, after looking over the formulae (and only understanding a handful of them), I created the following thingy:

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

Either drag the HSV sliders around or click the color chip in the lower left corner to modify the displayed color. The HSV values are (roughly) reflected in fields next to their respective sliders; the RGB values are displayed in fields to the right of the color chip in decimal, hexadecimal, and percentages.

So what's the point? I'm not entirely sure. I guess in a lot of ways, I think HSV is a more intuitive method for choosing a color than RGB, and the ultimate purpose for this color picker was (is?) a "game" for the unwashed (read: non-designer-y) masses My previous experiments (conducted back in the olden days) were coarse hacks compared to this iteration -- although, in fairness, they (mostly) worked, even if somewhat "particular." I guess I'm just excited to see that after all these years, I'm still capable of learning and improving. Or something.

If you want the source, it's right here!

Yet another color picker that doesn’t do much

A few hundred years ago, I started writing a color picker for a "game" was I building -- and game that's a direct rip off of a bunch of other games already out there, but hey. It was more or less functional (and it looked pretty), but under the covers, it wasn't as elegant as it could be.

So I started looking into bitwise operations -- those arcane and frightening invocations that do pure magic with numbers -- and learned a thing or 10. (That's a little bit of binary humor right there! [That was terrible.])

But wait! There’s more! »

Keyc—Keycode finder

Maybe you're a freak of nature who's memorized the entire Unicode table. Maybe you already have a handy dandy keycode chart plastered somewhere on your cubicle wall.

Then again, maybe you don't.

I frequently find myself searching for keycodes when I'm writing keyboard listeners; sure, it's a simple matter of glancing at the internet, but for those (e.g., people like me) that can't be bothered with such things, I threw together the following little application (click here to download):

Keyc screenshot

The EXE is around 3 M because (I can only assume!) the projector makes it so -- the SWF itself (included in the ZIP) is roughly 20 K.

To use it, just launch it and start mashing your keyboard! It's not terribly smart (it thinks the regular plus sign [+] is a double angle bracket [»]) -- and decidely sparse -- but if all you want to know is "What's the keycode for 'y'?", keyc will definitely do the trick.