add unit tests for HSB color space by Piyushrathoree · Pull Request #8376 · processing/p5.js

@Piyushrathoree

Resolves #8375

Changes: added unit test for src/color/color_spaces/hsb.js

PR Checklist

@Piyushrathoree

@Piyushrathoree

@davepagurek

Hey @limzykenneth, being more familiar with the HSB converters, how does this look to you?

limzykenneth

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.

@Piyushrathoree

@Piyushrathoree

@Piyushrathoree

@Piyushrathoree

@limzykenneth

@limzykenneth