A pure javascript implementation of Matrix Grid (used to generate Github-like random avatars)
https://flouthoc.github.io/minBlock.js/
<script type="text/javascript" src="https://raw.githubusercontent.com/flouthoc/minBlock.js/master/minBlock.js"></script>
Only the option canvasID is required.
new minBlock(canvasID: String);
or
new minBlock({
blocksPerEdge: Number, // default -> 5
canvasID: String, // required
color: {
primary: String,
secondary: String
}, // default -> a pair of random colors
padding: Number, // default -> 20
spacing: Number // default -> 0
});
<script type='text/javascript' src='https://raw.githubusercontent.com/flouthoc/minBlock.js/master/minBlock.js'></script>
<html>
<head>
<script type='text/javascript' src='minBlock.js'></script>
</head>
<body>
<canvas id='myCanvas' width='500' height='500'></canvas>
<script type='text/javascript'>
new minBlock('myCanvas');
</script>
</body>
</html>
new minBlock({
canvasID: 'myCanvas',
blocksPerEdge: 4,
color: {
primary: '#27ae60',
secondary: '#2ecc71'
},
padding: 0,
spacing: 2
});
Making it Sensitive for nxn MatrixFFby @GreenLantern101Simplifying Arguments To JSON formatby @alvaropinot