Skip to content

Instantly share code, notes, and snippets.

View richardbutler's full-sized avatar

Richard Butler richardbutler

  • Clippd
  • Maidenhead, Berkshire, UK
View GitHub Profile
@richardbutler
richardbutler / brightness.js
Last active December 24, 2015 23:49 — forked from kozo002/jquery.brightness.js
Quick fork of jquery.brightness.js, but without the jQuery dependency.
function brightness(el) {
var bgColor, rgba, y, parent;
bgColor = el.style.backgroundColor;
parent = el.parentNode;
function reportParent() {
return parent ? brightness(parent) : undefined;
}
if ((bgColor !== null) && bgColor.length) {