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

Added a function that creates a color from a hexadecimal string. #229

Closed
wants to merge 1 commit into from

Conversation

wcourtney31415
Copy link

In response to issue #217 by Anton-4, I wrote a function specifically for creating an elm-ui color using a hexadecimal color code.
The hex function returns a color given a valid string, but returns red if the input was invalid. The string is considered to be invalid if it doesn't start with a '#' sign, if it isn't 7 characters long including the '#', or if it includes characters that do not exist in hexadecimal format.

@Anton-4
Copy link

Anton-4 commented Jun 6, 2020

@wcourtney31415 thanks for your contribution, however I did implement this already in pr #222.
@mdgriffith can of course decide which implementation he likes best or combine them.

@Anton-4
Copy link

Anton-4 commented Jun 6, 2020

I only linked to the issue with the commit, not with the PR so I can see how you could have missed it.

@wcourtney31415
Copy link
Author

wcourtney31415 commented Jun 7, 2020

After I submitted my code, I noticed yours and looked it over. Yours has tests and some additional functionality that mine doesn't. That in mind, I believe yours is more fully fledged than mine. I expect mine to be rejected, but i'm going to leave it open for now in case pieces of my algorithm may be of some use.
Constructive criticism is much welcomed. This is one of my first pull requests, so there's still much for me to learn.
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.

2 participants