Javascript colour picker based on Prototype

I have written a small colour picker using the Prototype javascript library, which I thought I would share with the world.

It is very simple, but does the job suprisingly well. I may very well add extra features to it later on, so watch this space.
You can download the source file here.

Instructions for use

1. Include prototype.js and colourPicker.js in you html

2. Create a “target” element and a “trigger” element. The target element is the input tag that will store the colour hex code, so a text box or hidden input will work nicely. The trigger element is the element the user will click to popup the colour picker

  1. < input type=“text” name=“colour” id=“picker” value=“” />
  2. < a id=“trigger” >Pick a colour< /a>

3. Create an instance of the colour picker using the following javascript:

  1. var picker = new ColourPicker(‘picker’, ‘trigger’);

And that is it! Clicking the link will popup the colour picker and after a colour is selected, the text box will then have the hex value in it.
Future plans include better positioning of the popup, and callback functions to you can intecept the colour.

Update: you can see a demo here.

Spammers trying to fool your scanner - What the hell did they say?!

I find some of the spam I receive quite amusing. I use spam assassin on my server so I end up with quite a number of mails in my spam folder. Sometimes it fun to go through them and see what the spammers are trying to get past my filters. The following techniques often make me chuckle, and sometimes stare at my screen bewildered. Keep in mind that the idea of spam is to try and sell you something.

  1. Empty spam: These are message with no body. Sometimes they don’t even have a subject line. I don’t imagine the click-through from these mails is very high…
  2. Spam with no links or URLs or email addresses: Well now that you have convinced me that I need to purchase low-priced pharmaceuticals from your esteemed client, how do I actually do that?!
  3. Non-sensical spam: Sending spam with random string of text. Great for confusing the spam filters. Also great for confusing the user. I really don’t think I’m going to click on a link embedded in text that resembles Lorem Ipsum. If anyone can work out what this gem means, I’d love to hear from you (From a viagra spam):

on decoy on tibia be formica.
try pessimum try conspiracy or typography, the detest a cerebellum , exogamous it sin but company not brainwash.
and grandchildren be conjugacy some arroyo.
, consecrate but judicial but jensenor ginsburg , presbytery it quadrature.

Something in that for all of us really…