Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. 'use strict'
  2.  
  3. let colour = {
  4. nR: '',
  5. nG: '',
  6. nB: '',
  7. setColour: function (r, g, b) {
  8. this.nR = r;
  9. this.nG = g;
  10. this.nB = b;
  11. },
  12. showColour: function () {
  13. console.log(`rgb(${colour.nR}, ${colour.nG}, ${colour.nB})`);
  14. }
  15. };
  16.  
  17. colour.setColour(12,34,56);
  18. colour.showColour();
  19. colour.setColour(255,124,56);
  20. colour.showColour();
  21. colour.setColour(255,0,100);
  22. colour.showColour();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement