An open API service indexing awesome lists of open source software.

https://github.com/tabone/noci

Procedural Icon Generator
https://github.com/tabone/noci

Last synced: 11 days ago
JSON representation

Procedural Icon Generator

Awesome Lists containing this project

README

          


NOCI

NOCI
NOCI
NOCI

Procedural Avatar Generator

[![npm version](https://badge.fury.io/js/noci.svg)](https://badge.fury.io/js/noci)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

[Click Here For Demo](https://h33z5.csb.app/)


## Install

### NPM

```bash
npm install --save noci
```

### Yarn

```bash
yarn add noci
```

## Usage

```javascript
const grid = require('noci')({
width: 10,
height: 10,
iterations: 10,
seed: 'random-seed',
fold: 'VERTICAL' // Can also be 'HORIZONTAL' or 'BOTH'
})

grid.forEach(
(rows, y) => {
rows.forEach(
(cell, x) => {
switch (cell) {
case 'ALIVE' {
// Paint pixel at (`x`, `y`) with skin color.
break;
}
case 'CONTOUR': {
// Paint pixel at (`x`, `y`) with border color.
break;
}
default: { // or 'DEAD'
// Paint pixel at (`x`, `y`) with background color.
break;
}
}
}
)
}
)
```

# References
Based on the algorithm by [yurkth](https://github.com/yurkth/sprator).