-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support for serde (de)serialization of color types #83
Comments
Yes, absolutely! It should probably be quite straight forward to add and doing it behind a feature sounds like a good plan.
|
I'm adding this in #90. It will be just straight (de)serialization without anything too fancy. The only exceptions are the alpha types that will be flattened, so a JSON serialization of RGB with transparency will be Let me know if any of this doesn't work with your use case and maybe we can tweak it a bit. If you need other field names or a non-struct format, I would recommend creating a custom types for those representations and convert to and from palette types. |
To clarify: it's fine to reopen or continue the conversation even after it's merged. 🙂 |
I'm currently using
palette
in a downstream crate where I'd like to allow the user to serialize and deserialize customTheme
s - a set of styling defaults including some color types from palette. I'm hoping to avoid writing custom implementations of the serde traits in favour of adding the necessaryderive
s to palette itself where others may also find this useful. Perhaps this could be added as an opt-in feature similarly to cgmath, petgraph and others do?The text was updated successfully, but these errors were encountered: