I would suggest defining instance methods in javascript by putting it in the constructor, like

```javascript
function Renderer() {
    ...
}

Renderer.prototype.randomColor = function() {
    ....
}
```