Skip to content

Draft: Hex str or components

Rodrigo Valin requested to merge hex-str-or-components into master

This is a better (but still non-functional) approach at using both component and hex-string colors.

I'm using a custom serde deserializer, unfortunatelly, it is not yet working. Leaving it here so maybe you have a better idea on how to proceed (i'm too tired to continue today).

Got my inspiration from:

Errors we get

  • We get an error when trying to parse a hex string: invalid type: string \"#0000ffff\", expected RgbaComponents
  • We get an error because, even if RgbaComponets knows (eventually) how to deserialize itself from a string, the ColourDefinition Enum can't match the String representation and it does not know to which enum variation this color matches.
Edited by Rodrigo Valin

Merge request reports