Date: 2004-05-20 12:38 pm (UTC)
From: [identity profile] ex-orin917.livejournal.com
Actually it appears to have nothing to do with that. I suspect it's somehow messing with the hex-to-rgb conversions.

My guess after some experimentation is it does the following (assuming an explicit colour name lookup fails):
1. Divide the string into three equal parts corresponding to Red, Green and Blue respectively.
2. For each part, read from left to right, accept only valid hex digit (0-9|A-F|a-f), stop once two have been found, or end of the part is reached. Concatenate digits, zero pad and convert to integer value.

Using that formula:
"roliasnoom"
"rol", "ias", "noom"
"", "A", ""
00, A0, 00
0, 160, 00

It certainly seems to hold true. Orin would indeed be black since it contains no hex digits and a scren grab confirms "roliasnoom" is RGB(0,160,0).

Date: 2004-05-20 12:40 pm (UTC)
From: [identity profile] jackofallgeeks.livejournal.com
Ha! Now that is clever!

Date: 2004-05-20 01:10 pm (UTC)
From: [identity profile] ex-orin917.livejournal.com
Well at least now it won't keep me awake at 3am. These things bother me. ;)

Profile

jackofallgeeks: (Default)
John Noble

August 2012

S M T W T F S
   12 34
567891011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 1st, 2025 08:08 pm
Powered by Dreamwidth Studios