Closed waywardmonkeys closed 6 days ago
The fact that this uses the derive
feature for serde
doesn't change the decision to not use it for bytemuck
.
In particular, crates like resvg
, tiny-skia
, and those from Makepad do use bytemuck
, don't use serde
and very much do not want a dependency on the whole proc macro world that serde-derive
builds on.
This adds support for
serde::Deserialize
andserde::Serialize
usingserde-derive
forAlphaColor
,OpaqueColor
,PremulColor
,Rgba8
.This does not provide it for
DynamicColor
to avoid dealing with the non-exhaustiveColorSpaceTag
.It uses
derive
rather than hand-implementing the traits as the latter is very verbose and most things usingserde
will already have enabled thederive
feature. (This is also true for the other Linebender crates.)