MCPcopy
hub / github.com/CesiumGS/cesium / equalsEpsilon

Method equalsEpsilon

packages/engine/Source/Core/Color.js:578–587  ·  view source on GitHub ↗

* Returns true if this Color equals other componentwise within the specified epsilon. * * @param {Color} other The Color to compare for equality. * @param {number} [epsilon=0.0] The epsilon to use for equality testing. * @returns {boolean} true if the Colors are

(other, epsilon)

Source from the content-addressed store, hash-verified

576 * @returns {boolean} <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.
577 */
578 equalsEpsilon(other, epsilon) {
579 return (
580 this === other || //
581 (defined(other) && //
582 Math.abs(this.red - other.red) <= epsilon && //
583 Math.abs(this.green - other.green) <= epsilon && //
584 Math.abs(this.blue - other.blue) <= epsilon && //
585 Math.abs(this.alpha - other.alpha) <= epsilon)
586 );
587 }
588
589 /**
590 * Creates a string representing this Color in the format '(red, green, blue, alpha)'.

Callers 15

setCameraFunction · 0.45
boundScaleFunction · 0.45
atmosphereNeedsUpdateFunction · 0.45
sameMousePositionFunction · 0.45
rotateCVOnTerrainFunction · 0.45
pan3DFunction · 0.45
tilt3DOnTerrainFunction · 0.45
look3DFunction · 0.45
createRegionFunction · 0.45

Calls 2

definedFunction · 0.70
absMethod · 0.45

Tested by

no test coverage detected