a web-simulator of hyperion with html5 canvas and websocket

  • my first post:)


    1, to get realtime data of led and image (python)

    Code
    ws.send('{"command":"ledcolors", "tan":2,"subcommand":"ledstream-start"}')
    ws.send('{"command":"ledcolors", "tan":1,"subcommand":"imagestream-start"}')



    2, to draw light effect with each "light"

    JavaScript
    var grd=ctx.createRadialGradient(x,y,2,x,y,r);
    grd.addColorStop(0,"rgba("+leds.slice(idx*3,(idx+1)*3).join(',')+",0.1)");
    grd.addColorStop(0.5,"rgba("+leds.slice(idx*3,(idx+1)*3).join(',')+",0.02)");
    grd.addColorStop(1,"rgba("+leds.slice(idx*3,(idx+1)*3).join(',')+",0)");


    and , check this gif

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!