Git Product home page Git Product logo

moorainbow's Introduction

mooRainbow

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.

Screenshot Screenshot

How to use

Add the mooRainbow JS and CSS File to your website

#HTML
<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:

#HTML
<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:

#JS
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!

Detailed Documentation

Syntax:

var myMooRainbow = new MooRainbow(element, options);

Arguments:

  1. element - the element where you want to attach mooRainbow
  2. options - options, see below for more details

Options

  • id - the id of mooRainbow (default: 'mooRainbow')
    Note: every object must have an unique id.
  • prefix - the prefix for your CSS classnames (default: 'moor-')
    i.e.: prefix: 'moor-' => in your CSS: .moor-okButton { color: #fff; }
  • imgPath - the path where the slider and the overlay images are contained (default: 'images/')
    Note: always put the '/' at the end
  • startColor - an array. the color you want MooRainbow starts with (default: [255, 0, 0])
    Note: it must be an RGB color given as array [RED, GREEN, BLUE]
  • onChange - a function to fire when the color change

moorainbow's People

Contributors

cbeloch avatar fancyoung avatar realityking avatar anutron avatar

Watchers

 avatar Mark Rebec avatar Chrisantha Perera avatar James Cloos avatar Davy Wentworth avatar Darren Cheng avatar Marc Fernandez avatar  avatar  avatar Jason avatar Mark Bult avatar Thankaroo avatar Roy Pfaffman avatar Muneeb Ahmad avatar  avatar Alex Katkova avatar Allison Phillips avatar Ashley Weinaug avatar Cole Jurden avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.