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

Handle hashless hex #211

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Handle hashless hex #211

merged 2 commits into from
Nov 7, 2024

Conversation

jamesnw
Copy link
Contributor

@jamesnw jamesnw commented Nov 4, 2024

Description

If a color input fails to parse as a color, and it has 3,4,6 and 8 characters, re-parse with a preceding #.

We could potentially make it a stricter check, perhaps checking all the characters are hexadecimal, or it doesn't already start with a #. The risks of over checking are fairly low.

Related Issue(s)

#210

Steps to test/reproduce

https://deploy-preview-211--oddcontrast.netlify.app/

Type or paste in hex values without (and with) a preceding hash.

Copy link

netlify bot commented Nov 4, 2024

Deploy Preview for oddcontrast ready!

Name Link
🔨 Latest commit 81d1b6a
🔍 Latest deploy log https://app.netlify.com/sites/oddcontrast/deploys/67290418b0b7bd0008f4cd52
😎 Deploy Preview https://deploy-preview-211--oddcontrast.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jgerigmeyer jgerigmeyer merged commit 9143bb8 into main Nov 7, 2024
7 checks passed
@jgerigmeyer jgerigmeyer deleted the hashless-hex branch November 7, 2024 19:57
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.

Assume a 6 character (or 8) color is Hex without needing the # at the beginning
2 participants