mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
update RgbHsvConversion.js
This commit is contained in:
@ -35,8 +35,7 @@ Test hsvToRgb-method
|
|||||||
[128, 32, 80]
|
[128, 32, 80]
|
||||||
|
|
||||||
Test rgbToHsv-method
|
Test rgbToHsv-method
|
||||||
approximate-assertions needed because of small deviations due to converting between
|
function "approximatelyEqualHsv" needed because of small deviations due to rounding for the RGB-values.
|
||||||
int-values and double-values.
|
|
||||||
> approximatelyEqualHsv(rgbToHsv(0, 0, 0), [0, 0, 0])
|
> approximatelyEqualHsv(rgbToHsv(0, 0, 0), [0, 0, 0])
|
||||||
true
|
true
|
||||||
> approximatelyEqualHsv(rgbToHsv(255, 255, 255), [0, 0, 1])
|
> approximatelyEqualHsv(rgbToHsv(255, 255, 255), [0, 0, 1])
|
||||||
|
Reference in New Issue
Block a user