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

Event "input:start" and "input:end" does not provide the color value #14

Closed
ringofhealth opened this issue Oct 23, 2017 · 3 comments
Closed
Assignees
Labels

Comments

@ringofhealth
Copy link

Hey,

is it possible to the value registered on these events, just like how it is right now on the color:change event? this would be incredibly useful to throttle the events to get the final value

@jaames jaames self-assigned this Oct 25, 2017
@jaames
Copy link
Owner

jaames commented Oct 25, 2017

Hi, sorry for the slow response. (:

I'm not sure if I understand the request properly. You're asking for the color picker's color object to be passed to the input:end and input:start events like it is with color:set, right?

@ringofhealth
Copy link
Author

Hey! No worries.

What I meant was that there is always a event listner for oncolor change. and the resulting object is a color object, meaning as I am dragging the color wheel around, i have a feed to all the colors.

It would be good to have the color object available on input:start and input:end,

so for example,

("color:change", (color)=>{
//color object exist here
})

while

("input:start", (color)=>{
// color doesnt exist here.
})

I'm not sure what the purpose of having input:start and end if we cant peek into what the value is.

Basically, If all I cared about is what the end color is, and what the start color is, there is no way to get to it right now.

I hope this helps

@jaames
Copy link
Owner

jaames commented Oct 29, 2017

Ahh, so, the color object that gets passed to the color:change callback is just for convenience, you can access it at all times from the color picker's color property. :)

e.g:

// create a new color picker
var example = new iro.ColorPicker("#example");

// using the color object from color:change like this:
example.on("color:change", function(color) {
     var hsv = color.hsv;
});

// is the same as this:
example.on("color:change", function() {
     var hsv = example.color.hsv
});

// but the latter works for other events:
example.on("input:start", function() {
     var hsv = example.color.hsv
});

I hope that helps! That said, if you still think passing the color into the other method callbacks would be easier, then I'd consider it for sure.

@jaames jaames closed this as completed Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants