static paintProbabilityBox(painter,
                               probability,
                               drawArea,
                               focusPoints = [],
                               backgroundColor = Config.DISPLAY_GATE_BACK_COLOR,
                               fillColor = Config.DISPLAY_GATE_FORE_COLOR) {
        painter.fillRect(drawArea, backgroundColor);
        let cen = drawArea.center();
        if (isNaN(probability)) {
            painter.fillPolygon([drawArea.bottomLeft(), drawArea.topLeft(), drawArea.topRight()], fillColor);
            painter.print("NaN", cen.x, cen.y, 'center', 'middle', 'red', '9pt sans-serif', drawArea.w, drawArea.h);
        } else {
            painter.fillRect(drawArea.takeBottomProportion(probability), fillColor);
            painter.print(
                MathPainter.describeProbability(probability, 1),
                cen.x,
                cen.y,
                'center',
                'middle',
                'black',
                '9pt sans-serif',
                drawArea.w,
                drawArea.h);
        }

        painter.strokeRect(drawArea, 'lightgray');


        // Tool tips.
        if (seq(focusPoints).any(pt => drawArea.containsPoint(pt))) {
            painter.strokeRect(drawArea, 'orange', 2);
            MathPainter.paintDeferredValueTooltip(
                painter,
                drawArea.right(),
                drawArea.y,
                'Chance of being ON if measured',
                (100*probability).toFixed(5) + "%");
        }
    }
@param {!Painter} painter
@param {!number} probability
@param {!Rect} drawArea
@param {!Array.<!Point>=} focusPoints
@param {!string=} backgroundColor
@param {!string=} fillColor