index.js
/* Handle picking colors using the pipet and drawing colors using the pencil */
Handle picking colors using the pipet and drawing colors using the pencil
Handle picking colors using the pipet and drawing colors using the pencil
function drawPixel(el) {
    if (document.body.classList.contains('pipet')) {
        currentColor = el.dataset.color;
        $('#picker').iris('color', "#" + currentColor);
        document.body.classList.add('pencil');
        document.body.classList.remove('pipet');
        return
    }
    if (el.dataset.color != currentColor) {
        el.dataset.color = currentColor;
        el.style.backgroundColor = '#' + currentColor;
        BluetoothMatrix.draw('#' + currentColor, $(el).attr('data-x'), $(el).attr('data-y'));
    }
}
function drawPixel ( el ) { if ( document . body . classList . contains ( 'pipet' ) ) { currentColor = el . dataset . color ; $ ( '#picker' ) . iris ( 'color' , "#" + currentColor ) ; document . body . classList . add ( 'pencil' ) ; document . body . classList . remove ( 'pipet' ) ; return } if ( el . dataset . color != currentColor ) { el . dataset . color = currentColor ; el . style . backgroundColor = '#' + currentColor ; BluetoothMatrix . draw ( '#' + currentColor , $ ( el ) . attr ( 'data-x' ) , $ ( el ) . attr ( 'data-y' ) ) ; } }
Handle picking colors using the pipet and drawing colors using the pencil
Handle picking colors using the pipet and drawing colors using the pencil