All Projects → mapbox → React Colorpickr

mapbox / React Colorpickr

Licence: isc
A themeable colorpicker with HSL and RGB support for React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Colorpickr

Colorpicker
A mininal but complete colorpicker desktop app
Stars: ✭ 766 (+325.56%)
Mutual labels:  rgb, color, color-picker, colorpicker
global-color-picker
start the script and click anywhere to get rgb value at the cursor location
Stars: ✭ 31 (-82.78%)
Mutual labels:  color, color-picker, rgb, colorpicker
andColorPicker
Color picker library for Android
Stars: ✭ 233 (+29.44%)
Mutual labels:  color-picker, hsl, rgb, colorpicker
Colorpicker
jQuery UI widget for color picking (similar to the one in Microsoft Office 2010).
Stars: ✭ 271 (+50.56%)
Mutual labels:  color, color-picker, colorpicker
Colorhighlight
🎨 Lightweight Color Highlight colorizer for Sublime Text
Stars: ✭ 76 (-57.78%)
Mutual labels:  rgb, hsl, color
Culori
A comprehensive color library for JavaScript.
Stars: ✭ 271 (+50.56%)
Mutual labels:  rgb, hsl, color
color
Standard representation of colors, encouraging sharing between packages.
Stars: ✭ 23 (-87.22%)
Mutual labels:  color, hsl, rgb
Sorted Colors
A tool to sort the named CSS colors in a way that it shows related colors together
Stars: ✭ 167 (-7.22%)
Mutual labels:  rgb, hsl, colorpicker
Color Studio
It is too hard to build coherent and accessible themes with the right colors. This should help.
Stars: ✭ 289 (+60.56%)
Mutual labels:  rgb, hsl, color-picker
Color Fns
🎨 Modern JavaScript color utilities library
Stars: ✭ 65 (-63.89%)
Mutual labels:  rgb, hsl, color
Kallewheel
A custom color wheel extension for Adobe Photoshop
Stars: ✭ 16 (-91.11%)
Mutual labels:  color, color-picker, colorpicker
Bootstrap Colorpicker
Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
Stars: ✭ 1,351 (+650.56%)
Mutual labels:  color, color-picker, colorpicker
ColorPicker
Customizable Color Picker control for WPF
Stars: ✭ 57 (-68.33%)
Mutual labels:  color-picker, hsl, rgb
colorsys.rs
Lib for modifying colors and converting to other spaces
Stars: ✭ 28 (-84.44%)
Mutual labels:  color, hsl, rgb
Chromatism
🌈 A simple set of utility functions for colours.
Stars: ✭ 1,763 (+879.44%)
Mutual labels:  rgb, hsl, color
przm
🎨 A simple, yet feature rich color picker and manipulator
Stars: ✭ 19 (-89.44%)
Mutual labels:  color, color-picker, rgb
Pickr
🎨 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!
Stars: ✭ 3,759 (+1988.33%)
Mutual labels:  color, color-picker, colorpicker
Hsluv Dart
Dart port of HSLuv, a human-friendly alternative to HSL based on human experiments.
Stars: ✭ 49 (-72.78%)
Mutual labels:  rgb, hsl, color-picker
ColorPickView
🐾一个自定义的颜色选择view
Stars: ✭ 19 (-89.44%)
Mutual labels:  color, color-picker, colorpicker
color
A library of well-tested helper methods for working with colors.
Stars: ✭ 13 (-92.78%)
Mutual labels:  color, hsl, rgb

A colorpicker for React

npm version Build Status

Demo

Install

npm install @mapbox/react-colorpickr

You'll also want to include a copy of colorpickr.css in your code.

<link href='react-colorpickr.css' rel='stylesheet' />

Usage

import React from 'react'
import ColorPicker from '@mapbox/react-colorpickr'

export default class Example extends React.PureComponent {
  onChange = color => {
    console.log(color);
  };

  render() {
    return (
      <ColorPicker onChange={this.onChange} />
    )
  }
}

Required properties

onChange

Value should be a function and is called whenever a color is updated from the colorpicker. Returns a color object.

Optional properties

theme

By default, react-colorpickr depends on Assembly and the CSS located in dist/colorpickr.css. You can however, override it thanks to react-themeable which react-colorpickr uses internally. See the properties used and the class name values in theme.js.

initialValue

Accepts any valid css color. If this isn't provided, a default color is used.

mode

Defaults to hsl. Initializes which color model tab is active. Possible options: hsl, rgb.

channel

Defaults to h. Initializes which color channel is active. Possible options: h, s, l, r, g, b.

reset

If reset is provided as a property with a value of true a reset button is added that when pressed, reverts back to the original color when the colorpicker is initialized on the page. Defaults to true.

mounted

To use internal methods from react-colorpickr, mounted provides access to the components instance. This is helpful for calling methods like overrideValue that can manually set a new color.

instance = null;

setInstance = picker => {
  this.instance = picker;
};

override = () => {
  this.instance.overrideValue('red');
};

render() {
  <div>
    <ColorPickr mounted={this.setInstance} onChange={console.log} />
    <button onClick={this.override}>Override</button>
  </div>
}

readOnly

If readOnly is provided with a value of true, the colorpicker will render in a readonly state with values clearly shown and selectable, but not editable.

Developing

npm install & npm start

Then open http://localhost:9966/example/ in browser.

Inspired by https://github.com/wangzuo/react-input-color

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].