weasel API - v0.8.0
    Preparing search index...

    Function pressureToWidth

    • Map a 0..1 pressure value to a stroke width.

      width(p) = minWidth + (maxWidth - minWidth) × p^gamma

      Mouse / non-stylus inputs report pressure === 0 (no button) or 0.5 (button held); callers that don't want uniform 0.5-pressure widths on mouse input should gate on pointerType === 'pen' upstream and feed a constant width on the non-stylus path.

      Parameters

      Returns number