0.3.3 • Published 7 years ago

samai v0.3.3

Weekly downloads
15
License
MIT
Repository
github
Last release
7 years ago

Samai

Pseudo-randomly generated patterns inspired by the Kente cloth tradition of Ghana.

Example

var options = {
    date: new Date('01-18-2018'),
    width: 400,
    dark_colors: ['#900', '#072'],
    light_colors: ['#AA6', '#990', '#222'],
    fabric_enabled: true,
    n: 37
};
var samai = new Samai(options);
var body = document.querySelector('body');
samai.getPNG().then(src => {
    body.style.backgroundSize = samai.width + 'px';
    body.style.background = "url('" + src + "')";
});

This code produces the following pattern:

pattern example

Dependencies

SVG.js (npm) (cdnjs)

Documentation

Check the jsdoc for more information.

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago