material-random-color-picker

0.1.0 • Public • Published

material-random-color-picker

Build Status Dependency Status Maintainability Inline docs npm version MIT License
this is for material design's color library.

motivation

sometimes, I need a color when I make mock design or framework in markup. it's slightly troublesome to choose color and check design. additionally, I'm usually using React.js or lit-html or something which generates HTML from javascript.
if it can be used like uuid, that would be nice, so I made it!

Example

Example page is here
and Example code is here

USAGE

first, you need below.

$ yarn add material-random-color-picker 
or 
$ npm i material-random-color-picker

and then, you need to import mrcp().

import mrcp from 'material-random-color-picker';
 
mrcp() // it will be rendered color randamly like #FFFFFF;

API

Basically, I refered to material design's color. Especially this page
if you got confused how to set option such as color , type , and level , please refer above page.

mrcp(option)
  • option: type is object
    • color: default is null and type is string
    • type: default is null and type is string
    • level: default is null and type is number
    • isObject: default is false and type is boolean
mrcp({color: 'red', type: 'lighten'})
// #ef9a9a
 
mrcp({isObject: true, level: 1})
// { code: "#84ffff", color: "cyan", id: 109, level:1, type: "accent" }
// just in case, id is a internal id. you don't need to care of it.

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i material-random-color-picker

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • takahiro-saeki