th; i+=4) {
            const depthValue = Math.min(depthModeRange.max, Math.max(depthModeRange.min, newPixelData[depthPixelIndex+1] << 8 | newPixelData[depthPixelIndex]));
            let hue = map(depthValue, depthModeRange.min, depthModeRange.max, 0, 1);
            hue *= range;
            hue = range - hue;
            const rgb = hsvToRgb(hue, 1, 1);

            pixelArray[i] = rgb[0];
            pixelArray[i+1] = rgb[1];
            pixelArray[i+2] = rgb[2];
            pixelArray[i+3] = 0xff;
   