New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
14K
decreased by-44.72%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc