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

Fix hex_to_rgb extracting a hex from non hex strings #6

Merged
merged 1 commit into from
Jan 22, 2023

Conversation

mthom26
Copy link
Contributor

@mthom26 mthom26 commented Jan 10, 2023

If a string had 3 or 6 valid ascii hex characters and one of those characters was the last character in the string the 'from_hex' function would return a valid hex. Returning an error if any invalid ascii hex is encountered in the string fixes this.

For example in the string 'Magenta' the hex extracted would be 'aea'.
Another one is 'DarkGray' being extracted as 'daa'.

@emgyrz emgyrz merged commit a5dfd28 into emgyrz:master Jan 22, 2023
@emgyrz
Copy link
Owner

emgyrz commented Jan 22, 2023

thanks!

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.

None yet

2 participants