Skip to content

Instantly share code, notes, and snippets.

@passcod
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save passcod/9405133 to your computer and use it in GitHub Desktop.
Save passcod/9405133 to your computer and use it in GitHub Desktop.
dis.cancon.setFillColor = dis.cancon.setFillColor || function(color,alpha) {
var d = document.createElement('div'), m;
d.style.color = color;
m = getComputedStyle(d).color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
this.fillStyle = 'rgba('+m[1]+','+m[2]+','+m[3]+','+alpha+')';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment