Skip to content
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

Allow Colors to be created from 3-digit hexadecimal codes #1686

Closed
FrankRay78 opened this issue Nov 13, 2024 · 3 comments · Fixed by #1708
Closed

Allow Colors to be created from 3-digit hexadecimal codes #1686

FrankRay78 opened this issue Nov 13, 2024 · 3 comments · Fixed by #1708
Assignees
Labels
feature good first issue Good for newcomers

Comments

@FrankRay78
Copy link
Contributor

FrankRay78 commented Nov 13, 2024

A Color can be created from a 6-digit hexadecimal code, either by FromHex or TryFromHex methods.

Support should be added for 3-digit hexadecimal codes.

eg. #09C which is the short version of #0099CC


Please upvote 👍 this issue if you are interested in it.

@github-project-automation github-project-automation bot moved this to Todo 🕑 in Spectre Console Nov 13, 2024
@FrankRay78 FrankRay78 added good first issue Good for newcomers and removed needs triage labels Nov 13, 2024
@github-project-automation github-project-automation bot moved this to Todo 🕑 in Spectre Console Nov 13, 2024
@FrankRay78 FrankRay78 changed the title Allow Colors to be created from 3-digit hexadecimal codes. Allow Colors to be created from 3-digit hexadecimal codes Nov 16, 2024
@TheMarteh
Copy link
Contributor

This seems like a relatively easy fix that I'll try to pick up as my first issue.

It seems that we are able to expand the original fromHex method, by taking the sanitized string, checking it for 3 characters, and doubling those.

@FrankRay78
Copy link
Contributor Author

Great @TheMarteh, I'll be the reviewer/your buddy. Don't hesitate to ask along the way.

@TheMarteh
Copy link
Contributor

Thanks a lot, @FrankRay78 . I've opened up PR #1708 with the implemented changes.

@github-project-automation github-project-automation bot moved this from Todo 🕑 to Done 🚀 in Spectre Console Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature good first issue Good for newcomers
Projects
Status: Done 🚀
Development

Successfully merging a pull request may close this issue.

2 participants