-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Color binding doesn't support alpha for hex strings missing an alpha portion #626
Comments
I was initially confused about this as well, but the (See how options / input params are processed for numbers vs for strings.) Similarly, the It's kind of subtle, but this is consistent with how these options are explained and demonstrated in the docs. |
I agree it's consistent, but it's very easy to think that the string input with alpha: true was just left out of the docs, because if you included every variation then nobody is going to read the 86 page long docs. I see that it's not a bug. I think it's not very useful/confusing to have a specific flag to include alpha but not have it work in some scenarios. |
Yeah for sure — or some kind of generic typing approach that would restrict the available options based on the type of the bound value might help. I'm working on a Tweakpane plugin to expand color handling by using the ColorJS library to back the internal color representation. This will bring support for CSS 4 color strings / more modern syntax, along with support for additional object / tuple param types. Hoping that can help with more demanding color use cases. Should be released in a week or two. |
Basically, Tweakpane respects a bound value. I assume that parameters with initial values like Users need to specify the alpha option explicitly if the pane cannot determine wheather the parameter has an alpha field. For example, |
When adding a binding with an initial value of a hex string with 3 or 6 digits (no alpha portion), the controller does not add an alpha slider.
I would expect declaring
{ alpha: true }
to always add a supporting alpha slider. As a workaround, you can add the alpha portion to the hex string.The text was updated successfully, but these errors were encountered: