Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Tom Van Oosterwyck
- * Tom is de beste
- * Created on 8/12/11 at 11:23
- */
- var Color = {
- nR : 0,
- nG : 0,
- nB : 0,
- showColor: function() {
- var sRGB =
- "rgb("+this.nR
- + ", " + this.nG
- + ", " + this.nB+ ")";
- alert(sRGB);
- },
- setColor: function(rood, groen, blauw) {
- this.nR = rood;
- this.nG = groen;
- this.nB = blauw;
- },
- setHexColor: function(hex){
- hex = hex.substring(1);
- var hR = hex.substring(0,2);
- var hG = hex.substring(2,4);
- var hB = hex.substring(4,6);
- this.nR = parseInt(hR,16);
- this.nG = parseInt(hG,16);
- this.nB = parseInt(hB,16);
- }
- };
Add Comment
Please, Sign In to add comment