3.1.0 • Published 9 years ago

jquery-colpick v3.1.0

Weekly downloads
866
License
-
Repository
github
Last release
9 years ago

colpick - A jQuery Color Picker

colpick is a simple Photoshop-style color picker jQuery plugin. Its interface is familiar for most users and it's also very lightweight loading less than 30 KB to the browser.

  • No images! Just a JS and a CSS file
  • Very intuitive Photoshop-like interface
  • Light and dark easy-to-customize CSS3 skins
  • Only 29 KB total, even less if minified and gziped
  • Works and looks nice even on IE7
  • Extremely easy to implement

Installation

Add colpick to your project using your the tool of you choice or download the files.

Bower

bower install jquery-colpick --save

npm

npm install jquery-colpick --save

Usage

Include colpick.js and colpick.css to into your application. Make sure you have included jQuery (v1.7.0+) as well.

<script src="js/colpick.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/colpick.css" type="text/css"/>

Browserify/Node

Require the module in your application. Don't forget to include the css file as well.

require('jquery-colpick');

Now you may call the colpick method on any jQuery object to create a color picker. By default you get a dropdown color picker.

<button id="colorpicker">Show Color Picker</button>
$('#colorpicker').colpick();

For more examples see Usage examples.

##Options##

##jQuery.fn Functions##

##Changes to josedvq's version##

  • Polyfill: New option 'polyfill' to work with native color input fields
  • Auto color: Get the default color from an element's 'value' attribute using jQuery function .val()
  • Custom parent: New option 'appendTo' to specify which element to append the picker to (PR #44)
  • CSS styles: New option 'styles' to specify additional styles to be set on the picker (PR #44)
  • UMD compatibility: Uses an UMD style closure to be loadable with AMD loaders (require.js) or CommonJS
  • 3 character hex support: Added support for entering three character hex codes as specificied in the CSS 2.1 spec (PR #43)
  • Fixed Issues: #16, #17, PR#58

Dual licensed under the MIT and GPLv2 licenses.

Fork of josedvq's colpick
Based on Stefan Petre's color picker