Snippets for working with colors A simple RGB object function RGB(r,g,b){ this.r = r; this.g = g; this.b = b; this.ease = function(newRGB,pct){ var newR = this.r + Math.round((newRGB.r - this.r)*pct); var newG = this.g + Math.round((newRGB.g - this.g)*pct); var newB = this.b + Math.round((newRGB.b - this.b)*pct); return new RGB(newR,newG,newB); } this.hex = function(){ var rhex, ghex, bhex; if ((rhex=this.r.toString(16)).length < 2) {rhex = "0"+rhex;} if ((ghex=this.g.toString(16)).length < 2) {ghex = "0"+ghex;} if ((bhex=this.b.toString(16)).length < 2) {bhex = "0"+bhex;} return "#"+rhex+ghex+bhex; } }
| Graph IRI | Count |
|---|---|
| http://dbkwik.webdatacommons.org | 5 |