Flat and simple color-picker library. No dependencies, no jquery.

Overview

Flat and simple color-picker

gzip size brotli size No dependencies Current version Support me


Demo

Fully Featured demo

Features

  • Simple: The interface is straight forward and easy to use.
  • Practical: Multiple color representations. Multiple themes.
  • Mobile-friendly: Works well on mobile devices and touch screens.
  • No dependencies

Themes

Dark Light
Dark theme Light theme

Getting Started

Note: The readme is always up-to-date with the latest commit. See Releases for installation instructions regarding to the latest version.

Browser

">
<link rel="stylesheet" href="dist/color-picker.min.css"/>
<script type="text/javascript" src="dist/color-picker.min.js">script>

Usage

// Simple example, see optional options for more configuration.
const picker = new ColorPickerControl({ 
    container: document.body, 
    theme: 'dark' 
});

You can find more examples here.

Events

Use the on(event, cb) and off(event, cb) functions to bind / unbind event listener.

Event Description Arguments
open Color picker got opened ColorPickerControlInstance
change Color has changed HSVaColorObject
close Color picker got closed ColorPickerControlInstance

Example:

{ console.log('Event: "change"', color); }); picker.on('close', (instance) => { console.log('Event: "close"', instance); });">
picker.on('open', (instance) => {
    console.log('Event: "open"', instance);
});
picker.on('change', (color) => {
    console.log('Event: "change"', color);
});
picker.on('close', (instance) => {
    console.log('Event: "close"', instance);
});
Comments
  • How can you directly set the picker to a colour in the front end?

    How can you directly set the picker to a colour in the front end?

    Hi, Ivan. The script is great, but I'm trying to set the picker to a certain colour value when it opens. Is there a way to do this? I've been throwing arguments into picker.update, but so far nothing has worked. Thanks.

    opened by mango-unchained 3
  • Option to disable or hide the alpha channel slider

    Option to disable or hide the alpha channel slider

    Hi,

    Is it possible that you might add an option to the configuration to disable or preferably hide the alpha channel slider? Currently I'm hiding it in a hard coded css way: https://github.com/H0rn0chse/GifBuilder/blob/main/styles/options.css#L50

    Thanks in advance.

    opened by H0rn0chse 2
  • Fix bug that prevents using it with code from README

    Fix bug that prevents using it with code from README

    On startup the following code from the README does not work with the current master branch:

    const picker = new ColorPickerControl({ 
        container: document.body, 
        theme: 'light' 
    });
    
    picker.on('init', (instance) => {
        console.log('Event: "init"', instance);
    });
    picker.on('open', (instance) => {
        console.log('Event: "open"', instance);
    });
    picker.on('change', (color) => {
        console.log('Event: "change"', color);
    });
    picker.on('close', (instance) => {
        console.log('Event: "close"', instance);
    });
    
    

    This is because eventListeners[event] is not initialized and so the push operation fails. This change lazily initializes the event type in eventListeners and resolves the issue without having to explicitly initialize each event.

    opened by relistan 0
  • [Feature] Display the brightness slider under the color cirlce

    [Feature] Display the brightness slider under the color cirlce

    Hello, I would like to have an option to show a slightly bigger brightness slider right under the color circle instead of on the side.

    Thank you very much.

    opened by BennyAlex 0
  • Debouncing multiple events on mouseclick

    Debouncing multiple events on mouseclick

    Hi Ivan when clicking on the color wheel in a webbrowser multiple "picker.on('change', function(color))" events get triggered within ~20ms. This is not the case when typing in new numbers. It is not an issue with physical keeping the button pressed; I made some tests with an clicking script. Is there a way to debounce or otherwise mitigate this behavior?

    opened by tinitaet 1
Releases(v1.0.0)
  • v1.0.0(Jul 19, 2022)

🎨 Flat, simple, multi-themed, responsive and hackable Color-Picker library.

?? Flat, simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!

Simon 3.9k Dec 27, 2022
Colr Pickr, a vanilla JavaScript color picker component built with SVGs, with features like saving colors. Similar design to the chrome-dev-tools color picker.

Colr Pickr Colr Pickr, a vanilla JavaScript color picking component built with SVGs, with features like saving colors. Similar design to the chrome-de

TEK 27 Jun 27, 2022
A simple color picker application written in pure JavaScript, for modern browsers.

Color Picker A simple color picker application written in pure JavaScript, for modern browsers. Has support for touch events. Touchy… touchy… Demo and

Taufik Nurrohman 207 Dec 14, 2022
Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.

Bootstrap Colorpicker Bootstrap Colorpicker is a modular color picker plugin for Bootstrap 4. THIS PROJECT IS NOT MAINTAINED ANYMORE. After almost 10

Javi Aguilar 1.4k Dec 22, 2022
A JavaScript component that is a date & time range picker, no need to build, no dependencies except Moment.js, that is based on Dan Grossman's bootstrap-daterangepicker.

vanilla-datetimerange-picker Overview. A JavaScript component that is a date & time range picker, no need to build, no dependencies except Moment.js,

null 22 Dec 6, 2022
Simple utils to pack arrays, objects and strings to a flat object (and back again).

packrup Simple utils to pack (and unpack) arrays and strings to a flat object. Status: In Development Please report any issues ?? Made possible by my

Harlan Wilton 15 Dec 23, 2022
Simple, Fast, Secure, Flat-File CMS

Bludit Simple, Fast and Flexible CMS. Bludit is a web application to build your own website or blog in seconds, it's completely free and open source.

BLUDIT 1.1k Dec 30, 2022
Change the color of an image to a specific color you have in mind.

image-recolor Run it: https://image-recolor.vercel.app/ image.recolor.mov Acknowledgments Daniel Büchele for the algorithm: https://twitter.com/daniel

Christopher Chedeau 21 Oct 25, 2022
A little toy app to help you find the nearest match for a given color within a Figma Tokens color palette.

Hey Palette So you've got a color palette in Figma and you've used the Figma Tokens plugin to export that palette to JSON. Let's say you have a color

Kalo Pilato 5 Nov 15, 2022
A NodeJS package to convert any RGB color to HEX color or viceversa. Also supports HSL conversion.

Unhex ?? A NodeJS package to convert any RGB color to HEX, HSL color or viceversa. Example div { color: #fff; background-color: #0070f3; } After r

Arnau Espin 2 Oct 1, 2022
BOOTFLAT is an open source Flat UI KIT based on Bootstrap 3.3.0 CSS framework

BOOTFLAT is an open source Flat UI KIT based on Bootstrap 3.3.0 CSS framework. It provides a faster, easier and less repetitive way for web developers to create elegant web apps.

bootflat 4.3k Dec 25, 2022
Ordered lists, flat or nested, multiple formats ordered lists.

logseq-plugin-ol 有序列表,单级或多级、多种样式的有序列表。 Ordered lists, flat or nested, multiple formats ordered lists. 使用展示 (Usage) 在想要展示为有序列表的块上添加一个以 #.ol 开头的标签就可以了。有

Seth Yuan 25 Jan 1, 2023
This package enables you to define your routes using the flat-routes convention.

Remix Flat Routes This package enables you to define your routes using the flat-routes convention. This is based on the gist by Ryan Florence ?? Insta

Kiliman 180 Jan 3, 2023
Lying flat is a 20 NFT collection on a custom marketplace built on Zora's protocol

Lying flat is an NFT Marketplace powered by ZORA ?? ?? ?? The codebase is open for everyone to use it as a boilerplate, customize it and deploy their

javvvs 17 Sep 20, 2022
Nepali Multi Date Picker for jQuery. Supports both single date selections and multiple date selection.

Nepali Multi Date Picker A simple yet powerful date picker based in Nepali calendar. Supports both single date selections and multiple date selection.

Sanil Shakya 4 May 23, 2022
A simplified jQuery date and time picker

jSunPicker A simplified jQuery date and time picker Why another Date picker? There are numerous date, time pickers out there. However, each of those l

null 1 May 31, 2022
Turn an HTML input box to a duration picker, without jQuery

html-duration-picker.js html-duration-picker.js is a very tiny JS library used for transforming a native HTML text input into a duration picker. The a

Dan Chif 27 Oct 19, 2022
A jQuery Plug-in to select the time with a clock inspired by the Android time picker.

Clock Timepicker Plugin for jQuery See a demo here A free jQuery Plug-in to select the time with a clock inspired by the Android time picker. This plu

Andy 51 Dec 22, 2022
A super-lightweight, highly configurable, cross-browser date / time picker jQuery plugin

Zebra Datepicker A super-lightweight, highly configurable, cross-browser date/time picker jQuery plugin Zebra_Datepicker is a small yet and highly con

Stefan Gabos 391 Dec 29, 2022