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

update positions on .color(value) #2

Open
tj opened this issue Sep 7, 2012 · 7 comments
Open

update positions on .color(value) #2

tj opened this issue Sep 7, 2012 · 7 comments

Comments

@tj
Copy link
Member

tj commented Sep 7, 2012

No description provided.

@heavyk
Copy link

heavyk commented Oct 31, 2012

hi visionmedia, I'm using the color-picker in a project of mine. I am willing to implement this feature if you're not already working on it. so, if you're willing to let me do it, I'd like to know how you want it implemented, and I'll make the pull request.

thanks

@tj
Copy link
Member Author

tj commented Oct 31, 2012

sure! that would be great I haven't started yet

@heavyk
Copy link

heavyk commented Oct 31, 2012

ok, I will be using this one as a reference:

http://www.knallgrau.at/code/colorpicker/demo

the important code being:

var hsv = YAHOO.util.Color.rgb2hsv( rgb[0], rgb[1], rgb[2] );
this.control.selector.style.left = Math.round(hsv[1] * this.control.pickerArea.offsetWidth) + "px";
    this.control.selector.style.top = Math.round((1 - hsv[2]) * this.control.pickerArea.offsetWidth) + "px";
    this.control.hueSlider.setValue((1 - hsv[0]));

peace!

@tj
Copy link
Member Author

tj commented Oct 31, 2012

might make a nice addition to https://github.com/component/color for some of those, i dont have HSV at the moment. ideally color would be split into RGBA / HSLA / HSVA etc

@heavyk
Copy link

heavyk commented Oct 31, 2012

yeah that's a good way to get rid of that unused function I left in the pull request. do you mind if I make component/color a dependency of color-picker so I can delete some of those functions?

other question: how do you feel about adding things to the template, which could be provided by the user? for example, automatically on the change event update input boxes with the hex/rgb/rgba values. maybe add the option to show the current color and previous color (like in photoshop/gimp)... or, would you prefer all that goes into an advanced-color-picker component? I would also like to add alpha.

@heavyk
Copy link

heavyk commented Oct 31, 2012

oh, here's another idea. instead of making a whole nother component, what if, in the component.json, when doing dependencies, a dependency of "*" is the master, but it could also reference to a branch, and derivatives of the component would simply be branches? (or is this how it already is?)

@tj
Copy link
Member Author

tj commented Oct 31, 2012

hmm tough call as far as the templating goes, there are definitely many small features that could be part of a color picker. I'd rather make those optional in other libs, and mixin like colorpickerWhatever(ColorPicker.prototype) or something, anything to prevent a lot of bloated options

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