Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

yields/colorpicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colorpicker

simple color picker, see the demo.

colorpicker

Installation

$ component install yields/colorpicker

Example

var el = document.querySelector('div');
var picker = require('colorpicker')(el);
picker.on('pick', function(){
  console.log(el.style.background); // "rgb(.., .., ..)"
});

API

new Picker(el)

Initialize a new ColorPicker on el.

picker.bind()

bind events.

picker.freeze(ms)

How much time in ms should the picker freeze after a click happened.

picker.refresh()

The method should be called if el height or width changes.

picker.move(y, x)

Move to y, x, this will also change the color.

picker.color({ hue, sat, lit })

Set the color manually.

picker.unbind()

Unbind all events.

License

MIT

About

minimal colorpicker.

Resources

Stars

Watchers

Forks

Packages

No packages published