mooRainbow is a Color-Picker which was originally written by Djamil Legato (w00fz).
You can attach mooRainbow to any DOM Element. mooRainbow will be opened by clicking on this element.
Works with mooTools 1.3 and 1.4.
Add the mooRainbow JS and CSS File to your website
<link rel="stylesheet" href="Assets/mooRainbow.css" type="text/css" /> <script src="js/mooRainbow.js" type="text/javascript"></script>
Now you have an input field somewhere on your website, the code could look like this:
<strong>Color:</strong> <input type="text" id="titleColor" name="titleColor" />
To attach a mooRainbow instance to this input field, you simply use the following code:
var r = new MooRainbow('titleColor', { imgPath: 'Assets/images/', // if this value is not set, mooRainbow will search for images in images/ onChange: function(color) { this.element.value = color.hex; } });
Thats it!
var myMooRainbow = new MooRainbow(element, options);
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus