0.1.0 • Published 8 years ago
material-random-color-picker v0.1.0
material-random-color-picker
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-pickerand 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 objectcolor: default isnulland type is stringtype: default isnulland type is stringlevel: default isnulland type is numberisObject: 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.