-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Property value converter for Eye Dropper Color Picker #10323
Comments
It could probably implement a custom property editor using Currently it just store an Not sure we want to store all the additional data you suggest, where it may be better/simpler to store an There are however ways vai C# or JavaScript to get alpha, convert hex > rgba, rgba to hex(a), etc. Most developers probably don't need more than just the color code: hex or rgba. The events returns Umbraco-CMS/src/Umbraco.Web.UI.Client/src/common/directives/components/umbcolorpicker.directive.js Lines 179 to 221 in d428a45
Umbraco-CMS/src/Umbraco.Web.UI.Client/src/views/propertyeditors/eyedropper/eyedropper.controller.js Line 24 in d428a45
so you have access to methods listed here, e.g |
Yes, I agree that all of it is not needed, it's just an example, but The data type offers controls for alpha, but later you need to write your own implementation to figure stuff out. The current implementation seems only to cater for the editor, but not for the developer who would be using it in the C# or Razor code. Could we not continue storing the string as the value, but use |
It could convert to value to a Sure the In that case, why not store these data as JSON instead as the @nul800sebastiaan do you have some input of how HQ wants this? |
Yes, totally agree that it doesn't need all the things in the example. It needs as minimum as possible, but also I think an There was never an issue with storing and returning the id as string or integer of content or media, but convenience led to returning So although you're right about everything, in my opinion it's not an elegant implementation currently and custom logic will be needed to figure out basic information about the stored data each time. |
Unfortunately, Bjarne is completely correct, adding a PVC now would be a breaking change for everyone who's already querying and converting the values for this editor. Unfortunately we didn't think of this at the time. We encourage you to do your own convertor, or as suggested a custom editor with convertor. Sorry for the inconvenience. 🙁 |
Umbraco version
v8
Description
Currently Eye Dropper Color Picker returns
object
in the ModelsBuilder and no meaningful context what the colour is.Would be great to return a custom Model with a range of various properties to work with:
How can you help?
No response
The text was updated successfully, but these errors were encountered: