Skip to content

Instantly share code, notes, and snippets.

@JordanForeman
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save JordanForeman/9190878 to your computer and use it in GitHub Desktop.

Select an option

Save JordanForeman/9190878 to your computer and use it in GitHub Desktop.
A simple JavaScript RGB class
var RGB = function(r, g, b){
this.r = r;
this.g = g;
this.b = b;
};
RGB.prototype.toString = function(){
var strBuilder =
[
"rgb(",
this.r,
",",
this.g,
",",
this.b,
")"
];
return strBuilder.join("");
};
@JordanForeman
Copy link
Author

A basic JavaScript RGB class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment