add unit tests for HSB color space by Piyushrathoree · Pull Request #8376 · processing/p5.js
Resolves #8375
Changes: added unit test for src/color/color_spaces/hsb.js
PR Checklist
-
npm run lintpasses - Inline reference is included / updated
- Unit tests are included / updated
Hey @limzykenneth, being more familiar with the HSB converters, how does this look to you?
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.
Comment on lines +18 to +25
| // 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; | ||
| }; |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks , implemented.
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.
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