September 16, 2006 15:37 | WebTech

Over mango and chocolate crepes

I coded up a little tiny PHP method that takes any text string and returns 5 usable "html" hexadecimal colors.

It's not as artful as I'd have liked it to be, but then again my programming skills are not everything I'd like them to be either. ;)

$name_colors_array = explode("--",chunk_split(md5($name),6,"--"));

Nothing exciting. Might use it to generate little visual cues of authorship for aggregated views... somewhere.

You can get 10 three letter hex colors by changing the 6 to 3.

I only need 1 or 4 for my purposes.

Update 2:
$name_colors_array2 = str_split(md5(""),6);
is shorter. ;)

1- カ−ル

And it works with Kanjis ;)