function RgbColor(r, g, b) {
    'use strict';
    //random number generator from 0 to 255
    this.rn = function () {
        return Math.round(Math.random() * 255);
    };
    //the three main properties of the object
    this.r = this.rn();
    this.g = this.rn();
    this.b = this.rn();
    //provides an array representation of the object
    this.toArray = function () {
        var a = [];
        a.push(this.r);
        a.push(this.g);
        a.push(this.b);
        return a;
    };
    //provides a CSS-formatted string representing the color
    this.toString = function () {
        return 'rgb(' + this.toArray() + ')';
    };
}
// Object Constructor - Used to randomly create colors in RGB format
Object Constructor - Used to randomly create colors in RGB format
Object Constructor - Used to randomly create colors in RGB format
function RgbColor(r, g, b) {
    'use strict';
    this.rn = function () {
        return Math.round(Math.random() * 255);
    };
    this.r = this.rn();
    this.g = this.rn();
    this.b = this.rn();
    this.toArray = function () {
        var a = [];
        a.push(this.r);
        a.push(this.g);
        a.push(this.b);
        return a;
    };
    this.toString = function () {
        return 'rgb(' + this.toArray() + ')';
    };
}
function RgbColor ( r , g , b ) { 'use strict' ; this . rn = function ( ) { return Math . round ( Math . random ( ) * 255 ) ; } ; this . r = this . rn ( ) ; this . g = this . rn ( ) ; this . b = this . rn ( ) ; this . toArray = function ( ) { var a = [ ] ; a . push ( this . r ) ; a . push ( this . g ) ; a . push ( this . b ) ; return a ; } ; this . toString = function ( ) { return 'rgb(' + this . toArray ( ) + ')' ; } ; }
Object Constructor - Used to randomly create colors in RGB format
Object Constructor - Used to randomly create colors in RGB format
//random number generator from 0 to 255 //the three main properties of the object //provides an array representation of the object //provides a CSS-formatted string representing the color