-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
add unit tests for HSB color space #8376
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
base: dev-2.0
Are you sure you want to change the base?
Conversation
|
@davepagurek please take look |
|
Hey @limzykenneth, being more familiar with the HSB converters, how does this look to you? |
limzykenneth
left a comment
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.
One inline thing but the rest are good. Thanks.
test/unit/color/hsb.js
Outdated
| // Helper function to compare arrays with tolerance | ||
| const arrayApproximately = (arr1, arr2, delta = 0.01) => { | ||
| if (arr1.length !== arr2.length) return false; | ||
| for (let i = 0; i < arr1.length; i++) { | ||
| if (Math.abs(arr1[i] - arr2[i]) > delta) return false; | ||
| } | ||
| return true; | ||
| }; |
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 part is not being used and is not defined in the right way for an assertion. If you'd want to continue exploring this you can follow the implementation here: https://github.com/processing/p5.js/blob/dev-2.0/test/js/chai_helpers.js#L7-L12.
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.
thanks , implemented.
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.
I'm not sure that it should be directly attached to assert like this, especially in this file. Also it is still not being used, if it is not to be used then it don't really need to be there.
f4091e9 to
ec34176
Compare
|
@limzykenneth removed that . check the tests as well. |
Resolves #8375
Changes: added unit test for src/color/color_spaces/hsb.js
PR Checklist
npm run lintpasses