random-srgb-color
v1.0.0
Published
Generate a random sRGB color.
Downloads
2
Readme
random-srgb-color
Generate a random srgb color.
Installation
npm install --save random-srgb-color
Usage
var randomSRGBColor = require('random-srgb-color')
randomSRGBColor() // => color(srgb .74 .21 .45)
randomSRGBColor(0, 1, 0, 1, 0, 1, 0, 1); // => color(srgb .10 .88 .42 / .62)
randomSRGBColor(0, 100, 0, 100, 0, 100); // => color(srgb 73% 58% 24%)
randomSRGBColor(0, 100, 0, 100, 0, 100, 0, 100); // => color(srgb 34% 58% 73% / 50%)
or
import randomSRGBColor from 'random-srgb-color'
randomSRGBColor() // => color(srgb .74 .21 .45)
randomSRGBColor(0, 1, 0, 1, 0, 1, 0, 1); // => color(srgb .10 .88 .42 / .62)
randomSRGBColor(0, 100, 0, 100, 0, 100); // => color(srgb 73% 58% 24%)
randomSRGBColor(0, 100, 0, 100, 0, 100, 0, 100); // => color(srgb 34% 58% 73% / 50%)
Acknowledgements
Inspired by random-hex-color by John Otander which is repackaged from a post by Paul Irish.
License
MIT
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Crafted for generative doings by Adam Morse (@mrmrs_).