2.0.6 • Published 10 days ago

create-color v2.0.6

Weekly downloads
122
License
MIT
Repository
github
Last release
10 days ago

Create color

npm version npm.io

A tiny (565 B) JavaScript library to generate permanent color from any string, array or object.

DEMO. Open in CodeSandbox

Install

npm install create-color
// or
yarn add create-color

Usage

const createColor = require("create-color");
// or
import createColor from "create-color";
// format by default: hex
const hex = createColor("canThereBeAnyText"); // => "#67cb22"
// from string
const hsl = createColor("canThereBeAnyText", { format: "hsl" }); // => "hsl(96,71%,46%)"

// from object
const hex = createColor(
  { name: "Andrey", age: 27, role: "user" },
  { format: "hex" }
); // => "#f6555d"

// from array
const rgb = createColor(["random", "color", "generation"], { format: "rgb" }); // => "rgb(218,179,136)"
2.0.5

10 days ago

2.0.6

10 days ago

2.0.3

3 years ago

2.0.4

3 years ago

2.0.2

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1-beta.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago