Giter Site home page Giter Site logo

color-picker's Introduction

ColorPicker

Simple color picker component. Chuck it on a page, in a Dialog, in a Popover etc.

js color picker component

Installation

$ component install component/color-picker

Example

var ColorPicker = require('color-picker');

var picker = new ColorPicker;
picker.el.appendTo('body');
picker.on('change', function(color){
  $('.rgb').text(color.toString()).css('background', color);
});

Events

  • change (color) when the color selection changes

API

ColorPicker#size(n)

Define the color picker width / height.

ColorPicker#width(n)

Define the color picker width.

ColorPicker#height(n)

Define the color picker height.

ColorPicker#color()

Get the current selected color object with .r, .g, and .b values. The .toString() method on these color objects is the string representation such as "rgb(255,0,0)".

ColorPicker#color(str)

Set the color value to str.

License

MIT

color-picker's People

Contributors

forbeslindesay avatar jonathanong avatar tj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

color-picker's Issues

No yellow on HI-DPI (retina) displays

I tried your picker out to control some LEDs via node.js on a pi. The colours on the picker itself seems to be inaccurate. For example, try and get a yellow or orange from the slider (on the right). I see only blue shades...

image

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.