Code Monkey home page Code Monkey logo

react-colorpickr's Issues

Move mode switching into it's own input

From #58

User often wants to use the H version of the color field but manually input an S value. To see an example of a similar UI that is more user-friendly, check out Photoshop: it uses explicit toggles to switch modes. I'd even be in favor of locking the color field in Hue mode always – it's the most familiar and intuitive way to pick a color.

More informative 'Reset color' button

The current/reset colors are identical when first opening up the pane, and it's not clear that one of them is designed to reset to the original value:

image

Consider adding icon or separating the two color squares (bad sketch below)

image

.babelrc causes issues in other projects

Seeing this error when trying to require the 4.x.x versions of react-colorpickr. My app is using browserify with babelify.

ReferenceError: [BABEL] /Users/saman/work_repos/maki-icons/node_modules/react-colorpickr/dist/colorpickr.js: Unknown option: /Users/saman/work_repos/maki-icons/node_modules/react-colorpickr/.babelrc.presets while parsing file: /Users/saman/work_repos/maki-icons/node_modules/react-colorpickr/dist/colorpickr.js

https://github.com/mapbox/react-colorpickr/blob/mb-pages/.babelrc

If I add the following:

[
    "babel-preset-es2015": "^6.3.13",
    "babel-preset-react": "^6.3.13",
    "babel-preset-stage-0": "^6.3.13",
]

as devDependencies in my project, the problem goes away, but that shouldn't' be required to use the colorpickr.

could not complier

react-colorpickr/index.js Line 206: Unexpected token <
You may need an appropriate loader to handle this file type.

return (
/* jshint ignore:start */
<div className='colorpickr' onClick={this._onClick}>
<div className='colorpickr-body'>
<div className='col'>

Errors when updating color

One thing to notice is that rgb colors and hsv colors are not 1-1 mapping, so hsv -> rgb -> hsv may not return the original hsv value. Thats why i check whether the color should be updated, which seems not quite elegant.

rotated range input is buggy

the rotated range input sometimes doesn't work or is unresponsive, and covers up other elements on the page. Should un-rotate this guy and place it along the bottom:

screen shot 2015-07-18 at 1 10 07 pm

Display reset color instead of button

Currently if the reset button is enabled, it jumps back to the previous color before.

But it might be more useful if this were a swatch of the original color to measure contrast alongside a changed one:

color-reset

Clicking on the original swatch would reset things. Thoughts @ajashton @nickidlugash ?

Don't pass all of this.state to `onChange`

What's received by an onChange listener should be nicely formatted as color values. Right now I'm passing everything which is a little silly and means private things are no longer private.

Remove localStorage

Remembering color mode preferences should be an application-level concern, not a component-level one.

Stop using eval under the hood

'unsafe-eval' ('store' via 'react-colorpicker' is being silly, Function('return this')(), could have other eval()/Function())

This is necessary to enable unsafe-eval rule in CSP downstream.

Adding "show" props

Wondering if there would be support for adding "show props" here. For example application that does not support alpha transparency can pass in prop to not show the alpha picker, etc... Thanks!

S and V mode color field controls are flipped

When S is active I control V:

screen shot 2015-10-27 at 11 24 06 pm

When V is active I control S:
screen shot 2015-10-27 at 11 24 33 pm


Maybe this should be on a different ticket, but I think the mode switch interaction is poorly designed. It doesn't match user intention to change the functionality of the color field based on which input is active. User often wants to use the H version of the color field but manually input an S value. To see an example of a similar UI that is more user-friendly, check out Photoshop: it uses explicit toggles to switch modes. I'd even be in favor of locking the color field in Hue mode always – it's the most familiar and intuitive way to pick a color.

Drag events are generally "sticky" and unreliable

Using Chrome 45 on Ubuntu.

Examples:

  • No matter what I do I can't drag the white circle all the way to the left or bottom of the square. It always gets stuck at a saturation or value of about 1-30.
  • The hue slider will get stuck at 345 or 350 and I can't drag it any further to the right
  • If I'm dragging the hue slider and my cursor leaves the very narrow rainbow track, the slider gets stuck in drag mode and will follow my cursor even after mouseup. I have to click again on the hue slider to stop it.

switch to csscolorparser

If we use csscolorparser, react-colorpickr will reuse the application's existing csscolorparser dependency instead of including color-parser alongside it

Provide ES5 version

Is it possible to provide ES5 version for use in browser without transpiling?

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.