-
Notifications
You must be signed in to change notification settings - Fork 584
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
Missing output formats #183
Comments
Are you using a form post to get the value? If not, you could get the value as |
Yes, I'm using an |
Hmm, I'm not sure about overloading the color toString call even more than it already is (https://github.com/bgrins/TinyColor/blob/master/tinycolor.js#L123-L160). The input is basically being set by
Or maybe even trim it on the server? I suppose it could be possible to provide a custom value rendering function that takes in a color and preferredFormat and returns a string. Would have to think about that a bit more though. |
Right, I can find an alternate solution to bypass In any case I'll probably have to do something, as |
I'm thinking about the idea of allowing a custom valueFormatter function... Would you want this to only set the value of the original input, or also to set the value of the visible input (with |
Right now, because we use It looks like we're using I can understand if you prefer not changing |
OK, so regarding firing change on move, there used to be an option for this, but it caused many issues. IIRC most had to deal with reverting and clicking out of the colorpicker. I also saw issue #173 was opened requesting the ability to fire change on move. We could revisit this, or at least come up with and document an 'official' workaround for how to accomplish this behavior. What is your current workaround for this, btw? Regarding the hex without the #, it still sounds like the formatter would be helpful here (really, issue #182 is a separate concern from this). Are you using a flat colorpicker? If not, have you seen clickoutFiresChange? http://bgrins.github.io/spectrum/#options-clickoutFiresChange. That will at least help you not have to wait for a hide event to get a change to fire. |
Also, Issue #184 |
Moving the discussion about firing change on move to #173. We can focus simply on the output formatting here. |
Sorry, not 100% sure which 'workaround' you are talking about. Here's what we do:
HTH |
While the input format is permissive, the output format isn't as flexible. For legacy reasons, we'd rather store colors as hex codes without the '#'. That's not a problem for input, but there's no corresponding output.
My first thought was to make a PR where
preferredFormat
can be a function, but because of the "feature" with formatting and alpha #182, it's not clear if that would be an acceptable feature.Otherwise having a "hex6short" or similar would work.
The text was updated successfully, but these errors were encountered: