Interaction design • webdevelopment • web art • photography

June 2004

colour subdomains

Some time ago I implemented a couple of php subdomain detection tricks for quick testing of hex and rgb colour codes: typing,,, (and so on) in your Address bar will fill the browser window with that particular colour.

As of today, in an attempt to pollute subdomainspace even further, html colour keywords such as,, are also supported.

Here's the full list:

aliceblue, antiquewhite, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet , brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dodgerblue, firebrick, floralwhite, forestgreen, gainsboro, ghostwhite, gold, goldenrod, gray, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightgoldenrodyellow, lightgreen, lightgrey, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen


now also supporting system colours, per Calm_Pear's request:

ActiveBorder, ActiveCaption, AppWorkspace, Background, ButtonFace, ButtonHighlight, ButtonShadow, ButtonText, CaptionText, GrayText, Highlight, HighlightText, InactiveBorder, InactiveCaption, InactiveCaptionText, InfoBackground, InfoText, Menu, MenuText, Scrollbar, ThreeDDarkShadow, ThreeDFace, ThreeDHighlight, ThreeDLightShadow, ThreeDShadow, Window, WindowFrame, WindowText

Calm_Pear wrote on 2004/06/09:
And while you're at it, why not implement the system colors as well? Like buttonface, background etc.

JQN wrote on 2004/06/09:
Milo, I do hope you did this with some kind of script or else you clearly have WAY to much time on your hands! ;-)

milov wrote on 2004/06/09:
Yeah right, I spent the last couple of years setting 256 * 256 * 256 = 16777216 subdomains by hand. :)

It's all handled by a couple of simple preg_match() checks on HTTP_HOST, actually.

Richard H. wrote on 2004/06/09:
And what about changing background color for your weblog with this feature, not only giving a blank coloured page?

milov wrote on 2004/06/09:
Naah, I like the idea of each colour having its own little homepage, with nothing else on it.

Rubin wrote on 2004/06/09:
If each page has the color with a link back to THIS page, google will worship you. (:

milov wrote on 2004/06/09:
I suspect Google is smart enough to not increase a site's pagerank based on the number of SUBdomains that link it (considering those can be so easily faked/multiplied); especially if they're subdomains of the site in question.

Arthur wrote on 2004/06/10:
Excellent job!
Only the comma-separated subdomains get errors coming from the Squid proxy here; it's complaining it is an invalid URL.

ACJ wrote on 2004/06/11:
I take it your hosts supports unlimited ammounts of subdomains. :p

absolut wrote on 2004/06/15:
milov do you create subdomains with php or manually? :)

milov wrote on 2004/06/15:
I don't actually 'create' any subdomains. All * hostnames resolve to my main index.php, wherein I extract the subdomain from the $HTTP_HOST var and see if it matches the allowed hex/rgb syntax or one of the colour keywords.

ix wrote on 2004/08/31:

the color page suffers. it's bugged by IE.. check for details

milov wrote on 2004/09/17:
thnx ix, i've fixed it...

single wrote on 2004/10/16:
do you have any idea how to use this practicaly? what is it for? for seo or something else

Milo wrote on 2005/02/03:

Now featuring auto-generated .png favicons (for Firefox) that match the color!

Mathieu 'P01' HENRI wrote on 2005/02/03:

Milo wrote on 2005/02/03:
It's real fun now to open a whole bunch of the color keywords mentioned above in tabs.

Jim wrote on 2005/07/05:
Dulux paints have a blue called Trafalgar. Battle of Trafalgar 200 years ago. Whats the RGB ?

Jan! wrote on 2005/07/05:
You might find that if you could get the paint's Pantone colour number or some such.

MSinclair wrote on 2005/10/28:
Ha! Very creative and original. :)

roham wrote on 2005/12/17:
how u do this ? "All * hostnames resolve to my main index.php"
how can i do that also ???

Milo wrote on 2005/12/17:
It depends on if you have access to the DNS configuration for your own domain. You'll probably have to ask your sysadmin/hosting provider to set this up for you.

Jan! wrote on 2005/12/20:
roham, you can check the $_SERVER['HTTP_HOST'] variable in your index.php and decided what to do based on its contents. (For example using preg_match)

Milo wrote on 2005/12/20:
yeah, but if nothing but www.sitename.tld or sitename.tld resolves to his site, there's not much to do.

Chris wrote on 2006/02/28:
Heh, the Google rank for each color page is quite high - I found this through

WHAK'd wrote on 2006/05/08:
Good job, you have made it so there is even more useless crap for me to waste time on with google, THANKS ;)

bbay wrote on 2006/05/25:
very cool! ;)

nkmoller wrote on 2006/06/24:
Nice source of inspiration when looking for cool colours to use in web design. I specially like the "thumbnails" of matching variations.

Janne wrote on 2006/11/29:
Good idea. The way it is carried out with the subdomain script is unique and inspiring. I stumbled on here via Google as i am working on a book based on one colour. Keep up the good work.

Jeroen Haan wrote on 2006/12/27:
The comma-separated subdomains triggers an error message in FireFox.

Nice work, never seen anything like this before. It does inspire me however...


Adam R wrote on 2007/03/15:
Just thought I'd share my bookmarklet I use to check CSS color info whenever I need to (powered by this mechanism):

javascript:(function(){var q, i; q=document.getSelection(); if (!q) {q=prompt(%22Enter a CSS color%22,%22%22);} if (q){q=q.replace(/#/,'');q=q.replace(/$/,'');document.location=%22;}})()

With any luck that'll show up correctly and it'll be copyable. You can either highlight text on a page and click this bookmarklet to go to the page or you can just click the bookmarklet and type the color info in directly.

Cheers for making such an awesome idea!

Gert wrote on 2008/02/07:
fyi, it says you can enter decimal values using a , but it is accually a .

Like Isn´t that strange either, never found a , in the rfc.

Btw, I do have access to the DNS settings of my domain, how do you let them all redirect to the main one?

btw, nicely done, simple, quick and elegant.

nkmoller wrote on 2008/05/14:
Has something happened to the "thumbnails" of matching colour variations? I cannot see them any more, and I don't find a function to turn them on.

speedy wrote on 2009/01/27:
you've done a great job. i was looking for something like this... ;)

cristian wrote on 2009/03/05:
i thought that you made them manualy. my mistake... :)

ScriptShow wrote on 2009/03/26:
Sometimes visited the page; is simply extraordinary, its contents are very interesting. Congratulations on the work done.

Thank you for sharing developments made.

Un Saludo.

nath wrote on 2009/04/22:
Still missing pimpelpaarsmeteengoudrandje...