Create brighter color for RGB color - Node.js CSS

Node.js examples for CSS:Color

Description

Create brighter color for RGB color

Demo Code

Util.RGBlighten = function(rgb,lighten) {
  var rgbtemp = /rgb\((\d+),?\s*(\d+),?\s*(\d+),?\s*\)/g.exec(rgb).slice(1,4);

  return "rgba(" + Math.round(rgbtemp[0]) + "," + Math.round(rgbtemp[1]) + "," + Math.round(rgbtemp[2])+ "," + lighten + ")";
}

Related Tutorials