All Projects → antelle → Small Color Picker

antelle / Small Color Picker

Licence: mit
jQuery color picker and button styles

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Small Color Picker

Jquery Minicolors
jQuery MiniColors Plugin
Stars: ✭ 948 (+5825%)
Mutual labels:  color-picker, jquery
Bootstrap Colorpicker
Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
Stars: ✭ 1,351 (+8343.75%)
Mutual labels:  color-picker, jquery
Colorpicker
jQuery UI widget for color picking (similar to the one in Microsoft Office 2010).
Stars: ✭ 271 (+1593.75%)
Mutual labels:  color-picker, jquery
Jquery Drawsvg
Lightweight, simple to use jQuery plugin to animate SVG paths
Stars: ✭ 759 (+4643.75%)
Mutual labels:  jquery
Colorpicker
A mininal but complete colorpicker desktop app
Stars: ✭ 766 (+4687.5%)
Mutual labels:  color-picker
Iro.js
🎨 Modular color picker widget for JavaScript, with support for a bunch of color formats
Stars: ✭ 796 (+4875%)
Mutual labels:  color-picker
Push State
Turn static web sites into dynamic web apps.
Stars: ✭ 16 (+0%)
Mutual labels:  jquery
Javaquarkbbs
基于Spring Boot实现的一个简易的Java社区
Stars: ✭ 755 (+4618.75%)
Mutual labels:  jquery
Jquery Powertip
💬 A jQuery plugin that creates hover tooltips.
Stars: ✭ 822 (+5037.5%)
Mutual labels:  jquery
Jquery Dropdown
Bootstrap-style dropdowns with some added features and no dependencies.
Stars: ✭ 788 (+4825%)
Mutual labels:  jquery
Tableexport
The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
Stars: ✭ 781 (+4781.25%)
Mutual labels:  jquery
Jquery Animatenumber
jQuery animate number
Stars: ✭ 768 (+4700%)
Mutual labels:  jquery
Hospital Management System
"Health Care hospital" Management System is designed for manage details about hospital patient,employee and rooms(10). Designed by using HTML / CSS / JS / JQUERY/ PHP (procedural php) / MYSQL.
Stars: ✭ 5 (-68.75%)
Mutual labels:  jquery
Domtastic
Small, fast, and modular DOM and event library for modern browsers.
Stars: ✭ 763 (+4668.75%)
Mutual labels:  jquery
Festivals
A Grails website that provides information about festivals
Stars: ✭ 5 (-68.75%)
Mutual labels:  jquery
Inspinia
This is only a copy of INSPINIA - Responsive Admin Theme
Stars: ✭ 755 (+4618.75%)
Mutual labels:  jquery
Jquery Rslitegrid
Input tabular data with your keyboard
Stars: ✭ 5 (-68.75%)
Mutual labels:  jquery
Must Watch Javascript
A useful list of must-watch talks about JavaScript
Stars: ✭ 6,545 (+40806.25%)
Mutual labels:  jquery
Jquery.print
Easy to use, Element Printing Plugin for jQuery
Stars: ✭ 772 (+4725%)
Mutual labels:  jquery
Trip.js
🚀 Trip.js is a plugin that can help you customize a tutorial trip easily with more flexibilities.
Stars: ✭ 789 (+4831.25%)
Mutual labels:  jquery

SmallColorPicker

SmallColorPicker is a tiny jQuery color picker licensed under MIT. Also the project includes buttons styles for color selection.
Live demo page is here. Screenshot:

Small color picker

Features

This color picker includes:

  • color wheel and text input modes;
  • minimalistic popup interface;
  • old (previous) and new (current) color display;
  • color buttons which will automatically change its color;
  • popup and static positioning;
  • text input of colors in natural language;
  • touch devices support;
  • multi-target popup mode (if initialized with several buttons, only one picker will be visible);
  • retina graphics.

This color picker does not include:

  • support of non-CSS3 browsers

Usage

SmallColorPicker initializations should look like this:

try {
    $(".color-btn").smallColorPicker({ /* options */ });
} catch (err) {
    // the browser is not supported
}

Please note: options object is mandatory, you can pass just {}.
You can use color picker either in static mode (e.g. in a control displayed on your page), or in popup mode. In case the picker is initialized in popup mode, only one picker will be created for jQuery selector used for initialization (you can see this on example.html page in the source code). If you are using color buttons from this library, the picker will automatically replace color values in them.
To get an earlier created color picker, call

var picker = $(".color-btn").smallColorPicker();  

If you wish, you can also use the picker in non-jQuery version (new SmallColorPicker.CirclePicker({})) but this is more complex and still requires jQuery for operation.

Options

$(".color-btn").smallColorPicker({
    placement: {
        position: "absolute", // positioning (ignored in popup mode)
        top: "0", // top posision (ignored in popup mode)
        left: "0", // left position (ignored in popup mode)
        parent: null, // don't pass this if you are using jQuery plugin version
        popup: true // popup or static color picker verson
    },
    colors: {
        colorOld: null, // old color (the one displayed on the left)
        colorNew: "#ff0000" // new color (displayed on the right; currently selected color)
    },
    texts: { // texts used in color picker
        ok: "OK",
        cancel: "Cancel",
        switchModeToNum: "Show numbers",
        switchModeToCol: "Show color wheel"
    },
    behavior: {
        rotate: true, // whether to rotate color shades square
        hideOnSelect: true, // auto hide picker on color select
        mode: SmallColorPicker.Mode.COLOR, // default color selection mode 
        switchMode: true, // whether the user can switch input mode
        animation: true // show/hide fade animation 
    }
});

Methods

This code explains usage of methods:

var picker = $(".color-btn").smallColorPicker(); // get the picker
picker.show(); // show the picker
picker.hide(); // hide the picker
picker.toggle(); // toggle picker visibility
picker.toggle(true); // show the picker
picker.toggle(false); // hide the picker
var visible = picker.isVisible(); // is the picker visible
picker.switchMode(); // switch input mode between color wheel and numberic
picker.switchMode(SmallColorPicker.Mode.COLOR); // switch to clor wheel mode
picker.switchMode(SmallColorPicker.Mode.NUMBER); // switch to numeric mode
picker.setColors("#ff0000"); // set the displayed (selected) color
picker.setColors("#ff0000", "#000000"); // set both colors: displayed (selected) and old (previously selected)
var parent = picker.parent(); // get picker current parent
picker.parent("#btn2"); // change picker parent
picker.destroy(); // completely remove color picker 

Events

Here's how to listen the picker events:

$(".color-btn").on {
    scp_ok: function(picker, color) {  }, // color is selected
    scp_cancel: function(picker, color) {  }, // color selection cancelled
    scp_show: function(picker) {  }, // picker is shown
    scp_hide: function(picker) {  } // picker is hidden
}

Building

Use grunt to build this project. It will put the result into ../build-v1 folder.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].