About: Colors (Working With)   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

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; } }

AttributesValues
rdfs:label
  • Colors (Working With)
rdfs:comment
  • 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; } }
dcterms:subject
abstract
  • 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; } } Example var pct = i / (rowsInList - 1); var fin = new RGB(128,128,128); var ini = new RGB(221,221,221); list[i].bgColor = ini.ease(fin,pct).hex(); See Also:
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software