1.2.0 • Published 6 years ago

random-open-color v1.2.0

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

random-open-color

Super fast random color generator from the open-color palette

Install

npm install --save random-open-color

Usage

const randomColor = require('random-open-color')

import randomColor from 'random-open-color')

const hexColor = randomColor([options = {}])
// returns -> '#h??????'

Options

You can specify an options object to modify the random color generator.

PropertyTypeDefaultDescription
excludedArray[]All colors in the array will be excluded from the random generator
minNumber0The minimal range of color selection. For example if you specify min = 1 all colors lower than 2 will be excluded
maxNumber9The maximal range of color selection.
shuffleBooleanfalseIf shuffle is true, ...

/*import randomColor from 'random-open-color'

randomColor({ excluded: 'gray' , min: 2, // min >= 0 && min < max max: 8, // max > min && max <= 9 shuffle: true })*/

License

Copyright (c) 2017 Christoph Biering, Licensed under the MIT license.