-
Notifications
You must be signed in to change notification settings - Fork 10
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 how mix
from wonder-blocks-color
formats single-digit color components
#2065
Conversation
🦋 Changeset detectedLatest commit: f46f000 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
mix
from wonder-blocks-color
returns single-digit color componentsmix
from wonder-blocks-color
formats single-digit color components
Size Change: +3 B (0%) Total Size: 89.7 kB
ℹ️ View Unchanged
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2065 +/- ##
==========================================
- Coverage 96.91% 96.91% -0.01%
==========================================
Files 235 235
Lines 26493 26492 -1
Branches 2355 2307 -48
==========================================
- Hits 25677 25676 -1
Misses 816 816
Continue to review full report in Codecov by Sentry.
|
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-keuymyxivf.chromatic.com/ Chromatic results:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, in the most part, though I think this should be a major
bump given that it changes functionality.
In addition, the test plan make tesc
doesn't make sense for Wonder Blocks as there is no make tesc
. Should be yarn test
or yarn jest packages/wonder-blocks-color
, I believe.
My review uses Conventional Comments to add context and set expectations for the comments I am leaving.
.changeset/afraid-rings-knock.md
Outdated
@@ -0,0 +1,5 @@ | |||
--- | |||
"@khanacademy/wonder-blocks-color": patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This is a breaking change for code that relies on the old behavior. As such I think this likely needs to be a major
change, though I could be persuaded down to minor
since it is unlikely that there is code relying on this.
@@ -61,10 +61,9 @@ const format = (color: Color): string => { | |||
const b = Math.round(color.b); | |||
|
|||
if (color.a === 1) { | |||
// @ts-expect-error [FEI-5019] - TS7006 - Parameter 'c' implicitly has an 'any' type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Thanks for taking the time to get rid of an error suppression!
Summary:
Previously, if the red, green, or blue component was less than 16, its hex digit would be repeated (e.g.
f
would becomeff
). With this change, we preserve the real value of the number by prepending a0
instead (e.g.f
becomes0f
).Test plan:
yarn run jest packages/wonder-blocks-color/src/util/__tests__/utils.test.ts