Skip to content

Instantly share code, notes, and snippets.

@romuald
Last active October 7, 2016 13:55
Show Gist options
  • Select an option

  • Save romuald/80db37855bc76115d04652995cf4dd13 to your computer and use it in GitHub Desktop.

Select an option

Save romuald/80db37855bc76115d04652995cf4dd13 to your computer and use it in GitHub Desktop.
Greasemonkey script to automatically colorize phabricator workboard columns
// ==UserScript==
// @name Phabricator rainbow columns
// @version 1.0
// @description Automatically colorize phabricator workboard columns to spot them more easily
// @author Romuald Brunet
// @run-at document-end
// @grant none
// ====== /!\ You should probably restrict this to your local phabricator instance ======
// @match http://my-phabricator-instance
// @include /^https?://.*?phabricator.*?/
// ==/UserScript==
(function() {
'use strict';
if ( !document.querySelector('#phabricator-standard-page') ) {
return;
}
var increment = 65, // hue increment for each column
i,
hue = 0,
saturation = 90,
luminosity = 48,
alpha = 0.8;
function hsla(hue) {
return 'hsla(' + hue + ',' +
saturation + '%, ' +
luminosity + '%, '+
alpha + ')';
}
var panels = document.querySelectorAll('.phui-workpanel-view');
for ( i=0; i < panels.length; i++) {
hue = (hue + increment) % 360;
panels[i].setAttribute('style', 'background-color:' + hsla(hue));
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment