Skip to content

derekmwright/noise.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Usage:

// Instantiate
var image = new noise();

// Generate Random Noise Pattern
image.generate();

// Add the DOM Element to your Document
document.body.appendChild(image.domElement);

// If you have a RequestAnimFrame loop you can use noise.generate() to create a new pattern. 
MainLoop() {
  image.generate();
  requestAnimFrame(MainLoop);
}

// Or apply it as a style to your webpage background
document.body.style.backgroundImage = "url(" + image.domElement.toDataURL("image/png") + ")";

...etc

Optional arguments for instantiation are: height, width, opacity, monochrome/color, size.

Default values are Height/Width: 200px, Opacity: 0.04, Monochromatic, Size: 1.


Enjoy.

About

Small JavaScript library to generate noise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published