0.3.3 • Published 6 years ago

samai v0.3.3

Weekly downloads
15
License
MIT
Repository
github
Last release
6 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

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago