MCPcopy Create free account
hub / github.com/TheAlgorithms/JavaScript / approximatelyEqualHsv

Function approximatelyEqualHsv

Conversions/RgbHsvConversion.js:84–90  ·  view source on GitHub ↗
(hsv1, hsv2)

Source from the content-addressed store, hash-verified

82}
83
84export function approximatelyEqualHsv(hsv1, hsv2) {
85 const bHue = Math.abs(hsv1[0] - hsv2[0]) < 0.2
86 const bSaturation = Math.abs(hsv1[1] - hsv2[1]) < 0.002
87 const bValue = Math.abs(hsv1[2] - hsv2[2]) < 0.002
88
89 return bHue && bSaturation && bValue
90}
91
92function getRgbBySection(
93 hueSection,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected