-
Notifications
You must be signed in to change notification settings - Fork 220
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
Add input validation #30
Comments
Do you think something like this would be helpful, where I've added "Current Color" as in the screenshot below? This only changes when the background color actually updates. I've done this on the It could be improved by showing both RGB, HSL, hex codes, and named colors (e.g. |
Hey @ukanuk, thank you for working on this, I appreciate it! However, I would prefer some sort of indication that the color is unsupported instead (e.g. a red border, possibly a
|
I love this site, both because it's so attractive and easy to use, and because it allows me to test colors with alpha values. Thank you!
One thing I noticed while playing around with it, though, was that there's no indicator when a user enters an invalid color code. If the input is invalid, the last valid entry silently remains. If a user enters an invalid color, the new pairs seems to be just as the last valid pair.
For example, the page begins with:
If a user modifies the foreground number and misses a percent sign or pastes a malformed color code,
output
and#results
remain unchanged, and the user may believe that their malformed color code is both valid and accessible, based on the unchanged success message.For example, each of the following invalid foreground colors will appear to be successful:
Swapping the colors then fails because the invalid color code can't update the background color, so that both colors are now identical, i.e., reversing "white / bloop!" says "bloop! / white" but the actual colors being compared are "white / white."
I wasn't quite able to see how colors were being parsed, but it'd be great to work out validation for color codes so that users, especially those less familiar with how the different types are formed, can see where they've made mistakes in using the tool (e.g., it's easy for beginners to a percent sign, or confuse RGB and HSL).
Thanks.
(P.S.: I'd like to help out if I can, but I'm feeling a bit dense in trying to see how the inputs are parsed.)
The text was updated successfully, but these errors were encountered: