jPaq Docs - Color.random()

Quick Stats

Target Platforms:  PC (JScript) and the web (JavaScript)
Download Count:  978

Summary

Produces a random color based on the specified criteria. Each of the parameters may be a number or an array of numbers. To specify a specific value, the numeric value must be in an array by itself. To specify a range, the values must be given in an array where the first element is the minimum value and the second element is the maximum value. To produce an independently random value, 0 or null should be specified. To produce a random value that must be greater than one or both of the other two non-zero parameters, you must enter a larger number. To produce a random value that is smaller than one or both of the other two non-zero parameters, you must enter a smaller number.

Parameters

  1. [r] => Object
    Optional. Used to specify the amount of red that may appear in the color.
  2. [g] => Object
    Optional. Used to specify the amount of green that may appear in the color.
  3. [b] => Object
    Optional. Used to specify the amount of blue that may appear in the color.

Returns

Color
A color object based on the specified parameters.

Related Examples

  1. Foreground vs. Background
    I think one of the biggest complaints of users and web designers is the fact that many times people use background colors that are too…