mwg API
    Preparing search index...

    Function glowFalloff

    • How much light a soft glow still carries at distance from its centre: 1 at the centre, easing to exactly 0 at radius, 0 past it. Pure, so a sign's falloff is checkable as arithmetic: the middle of a tube is always brighter than its rim.

      Parameters

      • distance: number
      • radius: number

      Returns number

      import { glowFalloff } from '@datamoc/mwg/two-d/render';

      console.log(glowFalloff(0, 24)); // 1 - the centre burns full
      console.log(glowFalloff(24, 24)); // 0 - the rim carries nothing
      console.log(glowFalloff(48, 24)); // 0 - past the rim stays dark