Download the PHP package mistic100/randomcolor without Composer
On this page you can find all versions of the php package mistic100/randomcolor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mistic100/randomcolor
More information about mistic100/randomcolor
Files in mistic100/randomcolor
Package randomcolor
Short Description Generate attractive random colors
License MIT
Homepage https://github.com/mistic100/RandomColor.php
Informations about the package randomcolor
Random Color
For generating attractive random colors.
This is a PHP port of David Merfield randomColor Javascript utility.
See the results on the demo.
Options
You can pass an options object to influence the type of color it produces. The options object accepts the following properties:
hue – Controls the hue of the generated color. You can pass a string representing a color name (e.g. 'orange'). Possible color names are red, orange, yellow, green, blue, purple, pink and monochrome. You can also pass an array of multiple hues or a specific hue (0 to 360).
luminosity – Controls the luminosity of the generated color. You can pass a string containing bright, light or dark.
alpha – A decimal between 0 and 1. Only relevant when using a format with an alpha channel. Defaults to a random value.
format – A string which specifies the format of the generated color. Possible values are hsv, hsl, hslCss, rgb, rgbCss, hex and their alpha variants hsva, hsla, hlsaCss, rgba, rgbaCss, hexa. Defaults to hex.
prng – A random (or not) number generator. mt_rand
is used as default one.
Examples
Other languages
RandomColor is available in JavaScript, C#, C++, Go, Haskell, Kotlin, Mathematica, Python, Swift, Perl6, Objective-C, Java, R, Reason, Dart, Ruby, Rust and Swift.
License
This project is licensed under the terms of the MIT license.