Skip to content

Conversation

@Adrigorithm
Copy link
Contributor

Description

It allows for Colours to be created from strings using constructor overloading. Please accept my first PRussy to Discord.Net :^)

Changes

  • new constructor taking a string (and an enum for possible future color formats))
  • tests for this constructor

@Misha-133
Copy link
Member

Since it's parsing a string value, the logic should go into a static Parse method
Could you do that? And also make a bool TryParse() one please

@Adrigorithm
Copy link
Contributor Author

Adrigorithm commented Aug 11, 2024

Added the bitmasking and uh the if (rawValue.StartsWith("0x")) was needed because people can actually create hex codes that include leading 0's :(

@Misha-133 Misha-133 enabled auto-merge (squash) August 14, 2024 19:55
@Misha-133 Misha-133 merged commit bc84b94 into discord-net:dev Aug 14, 2024
@itslychee
Copy link

image

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.

3 participants