Socket
Socket
Sign inDemoInstall

hash-color-material

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hash-color-material

Hashes a string or a number to a material color hex code.


Version published
Weekly downloads
142
decreased by-28.64%
Maintainers
1
Install size
8.89 kB
Created
Weekly downloads
 

Readme

Source

hash-color-material

Hashes a string or a number to a material color hex code.

Get started

First:

npm install hash-color-material

Then:

var hashColor = require('hash-color-material');
console.log(hashColor.getColorFromString('Hello world!'));

Usage

hashColor.getColorFromString('Hello world!');

The result is: #039BE5

Functions

hashColor.getColorFromString(str, darkColors, accentColors)

Hashes the passed string to a material color hex code.

  • str (string): The string which gets hashed to a material color hex code
  • darkColors (boolean): Whether to include brown, grey and blue-grey (optional, default: true)
  • accentColors (boolean): Whether to include accent colors (optional, default: true)
hashColor.getColorFromNumber(number, darkColors, accentColors)

Hashes the passed string to a material color hex code.

  • number (number): The number which gets hashed to a material color hex code
  • darkColors (boolean): Whether to include brown, grey and blue-grey (optional, default: true)
  • accentColors (boolean): Whether to include accent colors (optional, default: true)

Keywords

FAQs

Last updated on 26 Feb 2018

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