# flati

> Deterministic generator of unique flat colors

Latest version **0.0.4** (published 2014-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install flati
pnpm add flati
yarn add flati
bun add flati
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2014-07-28 |
| First published | 2014-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ixcon |
| Maintainers | onescript |
| Keywords | deterministic, unique, flat, color, colors, generator |

## Links

- npm: https://www.npmjs.com/package/flati
- Repository: https://github.com/Ixcon/flati
- Issues: https://github.com/Ixcon/flati/issues
- npm.io page: https://npm.io/package/flati

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2014-07-28
- 0.0.3 — 2014-07-27
- 0.0.2 — 2014-07-27
- 0.0.0 — 2014-07-26

## README

![flati](http://i62.tinypic.com/2aajbdj.jpg)

# flati

Deterministic generator of unique flat colors

## Installation

#### npm:
```sh
npm install flati --save
```

#### Bower:
```sh
bower install flati --save
```

* Package can be loaded via AMD, Node.js or globally with `window.flati`.

## Api

`flati(seed: String|Number, i: Optional Number)`

##### Returns value in RGB color space:
```javascript
{
    r: Number,
    g: Number, 
    b: Number,
    toString: Function // rgb(r, g, b)
}
```

## Usage:

For example if we want generate unique color for each user.

```javascript
var users = [
    {id: 'john'},
    {id: 'jane'},
    {id: 'jenny'}
];

users.forEach(function(user) {
    // use user id as seed
    var color1 = flati(user.id); // equal to flati(user.id, 0);
    var color2 = flati(user.id, 1);
});
```

* When you increment `i` parameter, it's guaranteed that two similar colors will not be generated consecutive.
* With the same seed, you always gets the same results.

---
_Source: https://npm.io/package/flati · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
