function setGridEvents($container, rgbaColor) {
    // Handle resize
    window.addEventListener(
        'resize',
        setGridHelperColumns($container, rgbaColor)
    );

    // Toggle grid
    let ctrlDown = false;
    let isActive = false;

    document.addEventListener('keydown', (e) => {
        if (e.key == 'Control') {
            ctrlDown = true;
        } else {
            if (ctrlDown && e.key == 'g') {
                if (isActive) {
                    $container.style.visibility = 'hidden';
                } else {
                    $container.style.visibility = 'visible';
                }

                isActive = !isActive;
            }
        }
    });

    document.addEventListener('keyup', (e) => {
        if (e.key == 'Control') {
            ctrlDown = false;
        }
    });
}
Set grid events

Resize to rebuild columns
Keydown/Keyup to toggle the grid display

@param {HTMLElement} $container - DOM Element that contains a list of generated columns
@param {string} rgbaColor       - RGBA color to stylize the generated columns