slayeroffice - web experiments gone horribly awry

06.28.2004 - Color List Favelet

The idea for this latest favelet occured to me when I was sampling colors from various sites for the Color Shift Experiment. Click the eyedropper, click the color, right click to copy the hex value, rinse, repeat...wouldn't it be nice to be able to get a list of all the colors a site uses with the push of a button?

So thats what this new tool does -- it parses through a site's style sheets, style attributes and even COLOR and BGCOLOR attributes (shame on you if you are still using those...) and drops each unique color it finds into a table along with it's hex and RGB values.

A couple of caveats:

  • As with the Style Sheet Tweak favelet, if your CSS document is not on the same domain, it can't parse it. Meaning if I use an absolute url to my style sheet as www.slayeroffice.com, but you are visiting the site as slayeroffice.com, it will complain. This is a browser restriction.
  • Due to the vastly different ways that MSIE and Mozilla based browsers treat the styleSheet object and the colors it returns, I've written seperate versions for each browser. They are indentical in functionality, though the Mozilla version is much faster.
  • Opera provides no access to the styleSheet object, so this thing is pretty useless in that browser. If I'm wrong about this, please tell me how I can go about it.
  • It does not list colors that are defined by their names, like "red" or "green".
  • It does not check deprecated attributes like ALINK and TEXT.

Should you find that the application is missing any colors you know are defined in a page, please send me a link to the page, the color not being listed and the browser you're using so I can address the problem.

As always, suggestions for improvements are welcome.

Right click the appropriate link for your browser to add this tool to your favorites:

You continue to amaze me with every new release. All hail the bookmarklet overloard, for truly he makes our jobs so much easier :D

(oh, and slayer rock, hehe..)
Posted by Andrew Krespanis on June 29, 2004 @ 9:36 am


Maybe it is just me, but I really miss a close button from your favlets.

I usually surf the web with hands of the keyboard and use mouse, but then suddenly have to reach back to keyboard for escape key.
Posted by Andres on June 29, 2004 @ 10:58 am


I 2nd the motion on adding a close button on the favelet suite popup. I also notice that usually only the "text" is clickable in that popup, however the UI makes each one look likea button. It would be cool if the whole line was clickable instead of just the text.
Posted by Andrew Wooldridge on June 29, 2004 @ 2:04 pm
Duly noted, Gentlemen. I'll try and get both requests taken care of over the next couple of days. Or, possibly tonight.
Posted by Steve on June 29, 2004 @ 2:09 pm
Steve, you're a God! This is bleedin' awesome!
Posted by Malarkey on June 30, 2004 @ 8:49 am
Great!, excellent bookmarklet..

You're the dude man.. !

Thanks
Posted by Dr-Leech on August 10, 2004 @ 10:31 am


Comments have been closed for this post.