Playing with colours (and a new apli)

Was playing around with colours the last couple of days. made 2 scripts and a new Apli.

Script 1: colour array generator. Basically i ripped a list of html colour codes of a site but wanted to use only a few of them and also wanted to be able to order them nicely. So made a little script for it.
http://www.thomassmart.com/Experiments/colourarray/ (the save/php output doesn't work in FF for some reason, have'nt debugged it because i didn't need it).

Script 2: colour select slider. This is a neat little slider script that allows a user to select a colour from an array of colours (that we made with the colour array maker script). http://www.thomassmart.com/Experiments/colourslider/

And the new Apli: START!
Its basically a place you can store your favorites and bookmarks to be accessed from anywhere (with Internet).  http://start.thomassmart.com
It uses the colour slider to style the page to the user's liking using some very sexy simple code to update the style of the page while the users moves the slider for each colour setting.

I used the AddRule function to do this:

function addCSStag(tag,content){
 if(IECSS){
  myCSS.addRule(tag, content);
 }else{
  var newRule = tag + '{' + content + ';}';
  var newIndex = myCSS.cssRules.length;
  myCSS.insertRule(newRule,newIndex);
 }
}

basically it adds a CSS rule to the end of your CSS document. As it is on the end this is what is displayed in the page. Allowing you to update the colours of all elements with that class as apposed to each element ID individually.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word