New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

customat

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

customat

Material design palette generator

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

Customat

Library for generation color palette based on the base color for material design.

Usage

Customat using some ES6 features therefore in production you can use ES5-compiled version customat.cmpld.js.

This is only one function that takes a single argument — the base color. The base color can be specified in one of the following formats:

  • Hex: 009688;
  • Hex with hash: #009688;
  • RGB: rgb(0, 150, 136);
  • RGB in percents: rgb(0%, 59%, 53%).

Result — an object that contains the generated palette in the same format (see example), or null on error.

In browser

Example:
<script src="customat.js"></script>
<script>
    var baseColor = '#009688',
        palette = customat(baseColor)

    console.log(palette)
</script>
Output:
{
    50: "#e0f2f1",
    100: "#b2dfdb",
    200: "#80cbc4",
    300: "#4db6ac",
    400: "#26a69a",
    500: "#009688",
    600: "#00897c",
    700: "#00786d",
    800: "#00695f",
    900: "#004d45"
}

In Node.js

Install:

npm install customat

Example:
var customat = require('./customat')
console.log(customat('rgb(0, 150, 136)'))
Output:
{
    '50': 'rgb(224,242,241)',
    '100': 'rgb(178,223,219)',
    '200': 'rgb(128,203,196)',
    '300': 'rgb(77,182,172)',
    '400': 'rgb(38,166,154)',
    '500': 'rgb(0,150,136)',
    '600': 'rgb(0,137,124)',
    '700': 'rgb(0,120,109)',
    '800': 'rgb(0,105,95)',
    '900': 'rgb(0,77,69)'
}

Version

0.3.0

Keywords

material

FAQs

Package last updated on 21 Dec 2015

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