lwood: (Default)
[personal profile] lwood

Even More Righteously Bitchin' UPDATE! Current theory is that this works as advertised on any browser that inherits from the old NCSA Mosaic codebase (Mosaic, Spyglass, Netscape, IE, Mozilla, Gecko, and derivatives thereof). Once I got the ball rolling with Ardie ([livejournal.com profile] ardaniel) and the Geek-Out Gang (of which, Constant Readers, I am the least elitest of members), I got grabbed to clean a house and attend a party. After I came home, the latest algorithm failed for name length over twelve, so mad props for Yohimbe to extrapolating pairs to triplets to general-case little letter clusters. Anyway, the real, improved, tested and approved answer to names of more than six characters is below, and it's different from the last one.

So, okay, everyone and their cousin is happily trying the "look what my LJ color is!" thing. I have to admit, I tried it too, and to my complete lack of surprise, I came out a dark blue.

Why lack of surprise? Well, there's the overall metaphysical lack of surprise, but the real non-shocker was because I know how color codes work in HTML... or I thought I did.

Care to be initiated into the mysteries? Then follow... there are some oddball maths within if your relationship to numbers is strictly of the checkbook-balancing variety, but I really do try and explain thoroughly. Oh, and most people wind up on the purple spectrum, somewhere between lavender, magenta, and mauve.

So, okay. Color in HTML is supposed to be handled by a six-digit hexadecimal value. If "hexadecimal" is not in your vocabulary, take a deep breath and count along with me here:

Hexadecimal (base sixteen) values
0123456789ABCDEF10
012345678910111213141516
Decimal (base ten, i.e. "normal") values

We're dealing in "base sixteen" here, a topic that may make certain slashlist readers giggle, but there you are. What may be tricker to wrap your mind around is that because hexadecimal "10" is really "sixteen" to decimal reckoning, this means what you learned about hundreds, tens, and ones places in third grade are now the places of "two hundred fifty-sixes," "sixteens" and "ones."

What this has to do with HTML color reckoning is that the normal color declaration is #RRGGBB -- RR, GG, and BB are the red, green, and blue "values" (how much of that primary color is in the shade you desire) for the color you want. RR, GG, and BB are expressed as hexadecimal numbers with a value of 00-FF hex (0-255 decimal) giving 256 possible choices per primary color: 0099FF would mean no red, a little more than half of the possible green, but dammit, turn that blue knob up to eleven!

For curiosity's sake, I should point out that the given example looks like this, a rather charming shade of sky blue.

And what, by Klono's chromium-plated clustered alveoli (woo, someone's been reading the Lensman series again), does this have to do with "look what color my name is!" Easy:

Take a name. We'll start with lwood because it behaves in a way I expect:

lwood

As a color, it's a fetching dark blue that hasn't a prayer of showing up in the default LJ view, so it's just as well as we're behing a cut:

lwood

Now, we take all the letters that aren't valid as hexadecimal numbers out and replace them with zeroes. This means we're only allowed A, B, C, D, E, and F, and all the zeroes we like.

0000d

Behold! And, now that you know the code (put another zero on the end to get a valid RRGGBB sort of number: 0000d0), you too can say, "oh, that's no red, no green, and a generous dollop of blue."


Funky-Fresh Update o' Leetness: M'kay, names of more than six characters are less tricksome than we first thought, now that the code from one of the few open-source inheritors of the codebase has been found, nailed to a wall, and examined thoroughly by Trained Professionals

So, take some long names like mirella, dasubergeek, ardaniel, or clewarahedwi:

mirella
dasubergeek
ardaniel
clewarahedwi

Replace all the unimportant characters with zeroes like before:

000e00a
da0be00ee0
a0da00e0
c0e0a0a0ed00

Count the number of letters in your name and divide by three. If there is a remainder, round UP one number -- so 7-9 character names think 3, 10-12 think 4, 13-15 think 5, and so on. We'll call this number N.

Split your name up into groups of N letters. Why N? Because that's what the code says. We'll get to the twos we need in a minute:

000 e00 a
da00 be00 ee0
a0d a00 e0
c0e0 a0a0 ed00

If the last group of N characters is less than N characters, pad with a zero or two until you have a group of N characters:

000 e00 a00
da00 be00 ee00
a0d a00 e00
c0e0 a0a0 ed00

You should have now only three groups of letters! If not, something is wrong, please check your math.

Almost there! Now take the first two letters from each of your little groups and discard the others, then get rid of the spaces:

00e0a0
dabeee
a0a0e0
c0a0ed

That, darling, is your color, at least as expressed by any browser possessing Mozilla's color-rendering code, and doesn't that look mahvelous on you? Last example:

00e0a0
da0e00
a0a0e0
c0a0d0

Warning: This entire exercise is beyond what the specifications allow for. We're off in that odd part of the map where they used to write Here Be Dragons. Therefore, be aware that while this works most-of-the-time, some names have unusual effects when viewed in one browser or another (e.g. lferion is red in IE, but black in Netscape). We believe this may have to do with characters that don't have more than two significant letters (i.e., ones you didn't change to zeroes) in the first chunk (N-length group) of a word -- in these cases, IE picks from the right, or lops off the first null, or something for names whose length is one more than a multiple of three. Netscape does the exact reverse when the name length is exactly a multiple of three. Names are parsed generally by these rules, but your mileage may otherwise vary, and if it does it's not my fault, Janice's fault, nor Yohimbe's. Go blame AOL and Microsoft for not rewriting the color parser they inherited from the UIUC Supercomputing Center for cripes' sake, which only makes it what, eight years old? Sheesh.

It is granted that this is more useful as an exercise in monitoring genelike activity in progam code than anything else... oh, well, it would also work as a New Age get rich quick/self-help scheme ("Your Name Has a Color! Find Out What It Is!") and if you do Ardaniel and I want a cut, and Yohimbe gets one too.

You'll find some examples here until I make my test page do something else.

-- Lorrie

Date: 2002-02-08 12:50 pm (UTC)
From: [identity profile] sunshinegirl.livejournal.com
Interesting. Thanks for explaining that.

Date: 2002-02-08 01:29 pm (UTC)
From: [identity profile] lwood.livejournal.com
I just posted the update, which is longer, more embarrassingly geeky, and cracks the code about longer names. 8-)

-- 2R

Date: 2002-02-08 03:28 pm (UTC)
ext_7899: the tenth doctor stands alone (Default)
From: [identity profile] rhipowered.livejournal.com

Not that geeky...well, fine.

Date: 2002-02-08 03:30 pm (UTC)
From: [identity profile] lwood.livejournal.com
No, what's getting obsessively geeky is trying to crack the algorithm for odd-numbered names of more than six letters -- better known as, "why is chewbacca c00bca?"

-- Lorrie (the Disgruntled)

Date: 2002-02-08 03:33 pm (UTC)
ext_7899: the tenth doctor stands alone (Default)
From: [identity profile] rhipowered.livejournal.com

But that is what 'my' color is.

Date: 2002-02-08 03:35 pm (UTC)
From: [identity profile] lwood.livejournal.com
Yeah, we're working on that. I mean, we are out in the lands of "unsupported behaviour," and of course it'd be blue with a name ending in 'ed.'

-- Lorrie

Date: 2002-02-08 01:04 pm (UTC)
From: [identity profile] ertla.livejournal.com
I wonder whether Oya is snickering about my colour being a purple, rather than a blue ... though it came out so pale it hardly counts as Oya's colour.

Date: 2002-02-08 01:29 pm (UTC)
From: [identity profile] lwood.livejournal.com
For greater geek points (because I've had so few lately) I just updated with the explanation for longer names. 8-)

-- L

Date: 2002-02-08 01:10 pm (UTC)
ardaniel: photo of Ard in her green hat (skuld)
From: [personal profile] ardaniel
The "something" it appears to do, best as Lorrie and I have managed to figure out, is take the first pair, the last pair, contract all double nulls into single nulls, and then take the second-to-last pair.

Thus "ardaniel" becomes "a0a0e0," a rather sickly periwinkle.

Date: 2002-02-08 01:28 pm (UTC)
From: [identity profile] dasubergeek.livejournal.com
I seem to be a fetching shade of lavender.

Date: 2002-02-08 01:30 pm (UTC)
From: [identity profile] lwood.livejournal.com
And behold, I have updated with More Words for the Geekpoint Impaired. Okay, most of them left when I tried to earnestly explain "hexadecimal," I know, but dammit, I just can't stop trying to get both friends lists to understand each other a little. 8-)

-- Lorrie

Date: 2002-02-08 01:47 pm (UTC)
ardaniel: photo of Ard in her green hat (skuld)
From: [personal profile] ardaniel
Works in Mozilla (0.96 Linux), IE, Netscape (4.78 Linux). Works in Galeon 0.12.1 (Linux).

Doesn't work in Konqueror for names greater than six characters (Konq version 2.2.1).

This is apparently a browser-variable goofiness, like my more spec-conversant friends are noting.

Date: 2002-02-08 01:54 pm (UTC)
From: [identity profile] lwood.livejournal.com
... but one that appears to ... well, not work, but behave consistently along the Mosaic line of codebase inheritance (Netscape/IE/Moz/etc), which is to say over 99% of the web browsers. Konqueror was developed independently from the ground up, and thus does not possess the Mosaic nature (http://www.tuxedo.org/~esr/jargon/html/entry/has-the-X-nature.html).

-- Lorrie (mmmm, geeky goodness)

Checking in

Date: 2002-02-08 01:57 pm (UTC)
From: (Anonymous)
And is a rather boring shade of blue.

Date: 2002-02-08 02:35 pm (UTC)
From: [identity profile] mnightwind.livejournal.com
Heh, I'm the same dark blue it seems. Alot of 0's and that final 'd'. Interesting though. :)

Date: 2002-02-08 04:30 pm (UTC)
From: [identity profile] i.livejournal.com
and i thought i had created a monster! thanks for explaining why this worked. i was just having a little fun, and now i have quite the full mailbox, as do a couple of my friends. i wonder if it made the meme charts?

Date: 2002-02-10 04:59 am (UTC)
From: [identity profile] banana.livejournal.com
I think you need to post a link for that meme tracking thing to work.
Bit of a swiz calling it a meme tracker if it only tracks popular links.

Date: 2002-02-08 08:14 pm (UTC)
From: [identity profile] lanthinel.livejournal.com
*blink blink*

Date: 2002-02-10 04:53 pm (UTC)
From: [identity profile] banana.livejournal.com
Some more quirks:
  1. Some colour names are defined: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow are in the HTML standard somewhere, and some synonyms seem to work (e.g. magenta for fuchsia). The X11 colour names also work. These names don't compute in the way you describe (e.g. I think that LavenderBlush should be 0ade00 by the scheme you describe, but it isn't)
  2. There are Mosaic-descended browser differences - look at this recent post (http://www.livejournal.com/talkread.bml?itemid=22777984) of mine - in IE the colour changes every third line, but in NS 4 and 6 it stops changing after the tenth line

Profile

lwood: (Default)
lwood

February 2011

S M T W T F S
  12345
6789 101112
13141516171819
20212223242526
2728     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 13th, 2026 01:55 pm
Powered by Dreamwidth Studios