🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

create-color

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-color

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

2.0.6
latest
Source
npm
Version published
Weekly downloads
2.7K
-11.8%
Maintainers
1
Weekly downloads
 
Created
Source

Create color

npm version

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)"

Keywords

hash

FAQs

Package last updated on 11 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts