<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <style>
        canvas {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 700px;
            height: 500px;
            margin: -250px 0 0 -350px;
        }
        body {
            background-color: navy;
        }
    </style>
</head>
<body>
    <canvas></canvas>
    <script>
        'use strict';
        var canvas = document.querySelector('canvas');
        canvas.width = 700;
        canvas.height = 500;

        var g = canvas.getContext('2d');

        var plasma = createPlasma(canvas.width, canvas.height);
        var hueShift = 0;

        function createPlasma(w, h) {
            var buffer = new Array(h);

            for (var y = 0; y < h; y++) {
                buffer[y] = new Array(w);

                for (var x = 0; x < w; x++) {

                    var value = Math.sin(x / 16.0);
                    value += Math.sin(y / 8.0);
                    value += Math.sin((x + y) / 16.0);
                    value += Math.sin(Math.sqrt(x * x + y * y) / 8.0);
                    value += 4;