Repository navigation
fix: read 3-digit hex colours and fall back to light for invalid inputs (#72) - #73
Merged
Merged
Conversation
…nce (blixvip#72) - Expand 3-digit hex color strings to 6 digits before computing luminance - Fall back to luminance 1 (light default) on invalid or unparsable inputs - Export luminance function from public/drafts.mjs - Add unit tests in test/drafts.test.js covering #fff, #ffffff, #000, #070708, and named colors Fixes blixvip#72
7 tasks done
Owner
|
Verified locally: Nice touch converting Thanks @Mohit-Gaur75. Merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #72.
#rgbto#rrggbb) inluminance()before parsing channels, so shorthand colors like#fffcompute the exact same luminance as#ffffff.1(light default used bycolors()) when given unparsable or named colors (e.g.'white', invalid hex).luminancefrompublic/drafts.mjs.test/drafts.test.jscovering#fff,#ffffff,#000,#070708, and'white'as requested.Verification
npm test: all 39 tests pass.npm run check: passes cleanly.