-
Notifications
You must be signed in to change notification settings - Fork 354
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
force update of color object #29
Comments
Looking forward to have this feature as well. |
Is there any way to do this? I am making some forms with color input from the user, and it seems there is no way to set the color from the outside. Very good plugin, but this is just strange. |
Same problem here... |
@xiaokaike can you please introduce publicly accessible colorChange method or any other way for us to hard refresh the current color values? Something similar to what you have in EditableInput.vue. Any help or hack in this direction will greatly help us. Thank you! |
If it's not possible or hard to do, can we at least have component re-fresh method? This way we can at least re-render component with updated color form outside. |
Looks like I found a solution! Color picker will not respond if you change any color model other than hex and opacity. If I change color like this in my methods it will update the color picker properly:
Again colorValue (from the input field) should be in HEX format #aabbcc. In my app I use RGBA, so it requires an extra conversion from RGBA to HEX to make it work (I don't show it here for simplicity). Good luck with your projects! |
Actually, when initialize new Vue({
el: '#app',
components: {
'photoshop-picker': photoshop
},
data () {
return {
colors: {
h: 50,
s: 0.5,
l: 0.2
}
}
},
}) or new Vue({
el: '#app',
components: {
'photoshop-picker': photoshop
},
data () {
return {
colors: '#ff0000'
}
},
}) etc. Then you can also update updateColor() {
this.colors = {
h: 100,
s: 0.5,
l: 0.2
}
} Please be aware that you must change the whole I will update the README in the next release. Thanks. |
Is there a way to update the color externally?
The text was updated successfully, but these errors were encountered: