Socket
Socket
Sign inDemoInstall

colorspace

Package Overview
Dependencies
7
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

colorspace

Generate HEX colors for a given namespace.


Version published
Maintainers
1
Weekly downloads
6,039,483
decreased by-30.02%

Weekly downloads

Readme

Source

colorspace

Colorspace is a simple module which generates HEX color codes for namespaces. The base color is decided by the first part of the namespace. All other parts of the namespace alters the color tone. This way you can visually see which namespaces belong together and which does not.

Installation

The module is released in the public npm registry and can be installed by running:

npm install --save colorspace

Usage

We assume that you've already required the module using the following code:

'use strict';

var colorspace = require('colorspace');

The returned function accepts 2 arguments:

  1. namespace string, The namespace that needs to have a HEX color generated.
  2. delimiter, string, optional, Delimiter to find the different sections of the namespace. Defaults to :
Example
console.log(colorspace('color')) // #6b4b3a
console.log(colorspace('color:space')) // #796B67

License

MIT

Keywords

FAQs

Last updated on 20 Oct 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc