Giter Club home page Giter Club logo

really-simple-color-picker's Introduction

Really Simple Color Picker
-------------------------------

Written by Lakshan Perera 
For more info please visit: http://www.web2media.net/laktek/?p=96
Source code is hosted at: http://github.com/laktek/really-simple-color-picker

Color Picker requires jQuery 1.2.6 or higher. So make sure to load it before Color Picker (there's no other dependencies!). 
For default styles of the color picker load the CSS file that comes with the plugin.

 <script language="javascript" type="text/javascript" src=jquery.min.js"></script>
 <script language="javascript" type="text/javascript" src="jquery.colorPicker.js"/></script>

 <link rel="stylesheet" href="colorPicker.css" type="text/css" />

Add a text field to take the color input.
  <div><label for="color1">Color 1</label> <input id="color1" type="text" name="color1" value="#333399" /></div>

Then call 'colorPicker' method on the text field when document loads.
<script language="javascript">
  jQuery(document).ready(function($) {
    $('#color1').colorPicker();
  }
</script>

Your favorite colors are missing? 
Just add them to the palette
<script language="javascript">
  //use this method to add new colors to palette
  $.fn.colorPicker.addColors(['000', '000', 'fff', 'fff']);
</script>

Or completely change the color palette as you need...
<script language="javascript">
  $.fn.colorPicker.defaultColors = ['000', '000', 'fff', 'fff'];
</script>

That’s all you have to do!


really-simple-color-picker's People

Contributors

laktek avatar

Stargazers

 avatar

Watchers

 avatar  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.