Skip to content

Conversation

@GeorgeMuscat
Copy link

@GeorgeMuscat GeorgeMuscat commented Mar 24, 2024

Added a public ColorIndex enum that has implementations for multiple traits to allow for easy conversions between colors and usize. The following are implemented:

  • From<ColorIndex> for Color
  • From<ColorIndex> for usize
  • TryFrom<usize> for ColorIndex
  • TryFrom<u64> for ColorIndex
  • TryFrom<Color> for ColorIndex

I believe this enum and the implementations are extremely useful for unsvg users as it maintains backwards compatibility while providing a self documenting interface that is easier to work with.

Please let me know if there is any issue :)

Resolves #6

@GeorgeMuscat GeorgeMuscat marked this pull request as draft March 25, 2024 14:19
@GeorgeMuscat GeorgeMuscat marked this pull request as ready for review March 25, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COLORS interface is unnecessarily difficult to work with.

1 participant