even more fun with subdomains 

Some time ago I implemented a couple of php subdomain detection tricks for quick testing of hex and rgb colour codes: typing ff0.milov.nl, cc6633.milov.nl, 100.100.200.milov.nl, 0.255.150.milov.nl (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 orange.milov.nl, aquamarine.milov.nl, greenyellow.milov.nl 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

Update:
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

comments

1. posted by Calm_Pear at 00:41 on June 09, 2004

And while you're at it, why not implement the system colors as well? Like buttonface, background etc.

2. posted by JQN at 00:53 on June 09, 2004

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

3. posted by milov at 00:57 on June 09, 2004

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.

4. posted by Richard H. at 10:47 on June 09, 2004

And what about changing background color for your weblog with this feature, not only giving a blank coloured page?

5. posted by milov at 12:08 on June 09, 2004

Naah, I like the idea of each colour having its own little homepage, with nothing else on it.

6. posted by Rubin at 18:54 on June 09, 2004

If each page has the color with a link back to THIS page, google will worship you. (:

7. posted by milov at 19:58 on June 09, 2004

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.

8. posted by Arthur at 12:31 on June 10, 2004

Excellent job!
Only the comma-separated subdomains get errors coming from the Squid proxy here; it's complaining it is an invalid URL.

9. posted by ACJ at 17:05 on June 11, 2004

I take it your hosts supports unlimited ammounts of subdomains. :p

10. posted by absolut at 09:09 on June 15, 2004

milov do you create subdomains with php or manually? :)

11. posted by milov at 11:05 on June 15, 2004

I don't actually 'create' any subdomains. All *.milov.nl 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.

12. posted by ix at 16:48 on August 31, 2004

nice!

the color page suffers. it's bugged by IE.. check http://www.bluerobot.com/web/css/fouc.asp for details

13. posted by milov at 05:28 on September 17, 2004

thnx ix, i've fixed it...

14. posted by single at 19:05 on October 16, 2004

do you have any idea how to use this practicaly? what is it for? for seo or something else

15. posted by Milo at 21:34 on February 03, 2005

Test.

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

16. posted by Mathieu 'P01' HENRI at 22:07 on February 03, 2005

:)

17. posted by Milo at 22:23 on February 03, 2005

It's real fun now to open a whole bunch of the color keywords mentioned above in tabs.

18. posted by Jim at 14:58 on July 05, 2005

Dulux paints have a blue called Trafalgar. Battle of Trafalgar 200 years ago. Whats the RGB ?

19. posted by Jan! at 15:36 on July 05, 2005

You might find that if you could get the paint's Pantone colour number or some such.

20. posted by gmail.com,mpsinclair,MSinclair at 19:09 on October 28, 2005

Ha! Very creative and original. :)

21. posted by gmail.com,rohmamiya,roham at 15:05 on December 17, 2005

how u do this ? "All *.milov.nl hostnames resolve to my main index.php"
how can i do that also ???

22. posted by Milo at 15:53 on December 17, 2005

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.

23. posted by Jan! at 22:34 on December 20, 2005

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)

24. posted by Milo at 22:57 on December 20, 2005

yeah, but if nothing but www.sitename.tld or sitename.tld resolves to his site, there's not much to do.

25. posted by Chris at 14:07 on February 28, 2006

Heh, the Google rank for each color page is quite high - I found this through http://threedlightshadow.milov.nl/

26. posted by WHAK'd at 15:38 on May 08, 2006

Good job, you have made it so there is even more useless crap for me to waste time on with google, THANKS ;)

27. posted by bbay at 17:31 on May 25, 2006

very cool! ;)

28. posted by nkm.net,post606,nkmoller at 08:40 on June 24, 2006

Nice source of inspiration when looking for cool colours to use in web design. I specially like the "thumbnails" of matching variations.

29. posted by Janne at 02:49 on November 29, 2006

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.

30. posted by Jeroen Haan at 16:00 on December 27, 2006

The comma-separated subdomains triggers an error message in FireFox.

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

cheers

31. posted by Adam R at 11:41 on March 15, 2007

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=%22http://%22+q+%22.milov.nl%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!

32. posted by Gert at 22:57 on February 07, 2008

fyi, it says you can enter decimal values using a , but it is accually a .

Like 200.200.200.milov.nl. 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.

33. posted by nkm.net,post801,nkmoller at 00:22 on May 14, 2008

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.

34. posted by speedy at 14:56 on January 27, 2009

you've done a great job. i was looking for something like this... ;)

35. posted by cristian at 20:12 on March 05, 2009

i thought that you made them manualy. my mistake... :)

36. posted by ScriptShow at 12:44 on March 26, 2009

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.

37. posted by nath at 11:30 on April 22, 2009

Still missing pimpelpaarsmeteengoudrandje...

add a comment

Note: no HTML allowed. URLs starting with http:// are automatically turned into working links. Please don't spam.