rt from ms to s.
  var touchDown = td / 1000;
  var touchUp = tu / 1000;
  var totalElapsed = touchDown + touchUp;

  if (tu <= 0) {  // before touch up
    return waveInitialOpacity;
  }
  return Math.max(0, waveInitialOpacity - touchUp * waveOpacityDecayVelocity);
}

function waveOuterOpacityFn(td, tu) {
  // Convert from ms to s.
  var touchDown = td / 1000;
  var touchUp = tu / 1000;

  // Linear increase in background opacity, capped at the opacity
  // of the wavefront (waveOpacity).
  var outerOpacit