Node.js examples for CSS:Color
String to Color Array
String.prototype.toColorArray = function() { var x = /#([a-gA-G0-9]{2})([a-gA-G0-9]{2})([a-gA-G0-9]{2})/; var a = x.exec( this.toString() ).slice(1); for (var i = 0; i < a.length; i++) { a[i] = parseInt( a[i], 16 );/*from ww w . j ava2 s. c o m*/ } return a; };