Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable brightness bar #10

Closed
ringofhealth opened this issue Oct 13, 2017 · 3 comments
Closed

disable brightness bar #10

ringofhealth opened this issue Oct 13, 2017 · 3 comments

Comments

@ringofhealth
Copy link

Hi,

let me say this first, this is one of the best color picker wheel implementations out there! simple to easy, low friction api and very well designed!

I just had a question, is there a way for me to disable the brightness bar? or a way to pass in a init option?

Thanks!

@ringofhealth
Copy link
Author

ringofhealth commented Oct 13, 2017

Also I cant seem to register a callback on my color picker with watch

if i have the following

    var colorPicker = new iro.ColorPicker("#example");
    colorPicker.watch(function(newHsv, oldHsv, changed) {
// if the hue channel changed, log the new hue value to the console:
   if(changed.h) {
	console.log(newHsv.h)
    }

// if the saturation channel changed, log the old saturation value to the console:
if(changed.s) {
	console.log(oldHsv.s)
     }
})

seems like changed becomes undefined.

am i doing something wrong?

@jaames
Copy link
Owner

jaames commented Oct 13, 2017

Hello! Thank you very much, I'm glad you like the library!

There was another request to make the brightness slider optional, if that's something you'd like to see then feel free to join the discussion on this thread, and let me know what you think of the suggested changes. :>


Regarding the watch method, iirc this behaviour was changed in the transition between v1 + v2. Currently, the watch callback is only provided the color picker's color object.

That said, if you would like the changed value to be added back to the watch method callback, that can certainly be done.

@jaames
Copy link
Owner

jaames commented Feb 22, 2019

iro.js version 4.0.0 is now live, which provides the ability to disable the brightness bar with the new custom layout option:

var colorPicker = new iro.ColorPicker('#color-picker', {
  layout: [
    {
      component: iro.ui.Wheel,
      options: {}
    }
  ]
});

--

Sorry for taking so long to find a good way to implement this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants