Marak/Faker.js — pull request #64 by cyanos (2013-11-06 01:09:48+00:00)
Title: Add Random Tree and Random RBG Color

##Random Tree##

### Description ###
Will generate a random tree filled with data

### Usage ###
createTree(depth, width, obj) where
- depth is the distance from the root to the farthest node
- width is the number of children to add to each node
- each property/value pair in obj contains a value that will be evaluated to get the final result. The property that contains the array of child nodes should have the value of "__RECURSE__"

### Example ###
```
var proto = {"name": "Faker.Name.findName()",
"children": "__RECURSE__"};

var card = Faker.Tree.createTree(8, 3,proto);
```
This will create a tree that is 8 levels deep from the root, with 3 children at each level, where "children" is filled up with more instances of the "proto" object. It will look something like this:

```
{name: [[random name 1]],
children: [
{name: [[random name 1.1]],
children: [
{name: [[random name 1.1.1]],
children: [ ... and so on, for a total of 8 levels ... ]},
{ ... },
{ ... }]},
{ ... },
{ ... }]}
```

## Color ##

### Description ###
Generates random color value, given a base color. All colors will be "compatible" with the base color.

### Usage ###
```
var color = Faker.Internet.color(127,170,255); // generates a different color each time, but all will be based on r=127, g=170, b=255
```