Pridify Your GitHub Contributions Graph

/pridify-your-github-contributions-graph 2015-06-27T19:17:41+01:00

I saw this Tweet…

… and thought I wanted some of that too. So here you go, my "pridified" GitHub contributions graph:

Pridified GitHub contributions graph

For those who want to it too, and don't want to follow another link to the Gist, open up the Developer Tools in your favourite browser and paste this code into the Javascript console:

var GH = ['#EEEEEE', '#D6E685', '#8CC665', '#44A340', '#1E6823'];
var CO = ['#EF4B4D', '#F89B47', '#FAEA20', '#7DC242', '#5D94CE', '#855CA7'];

var graph = document.getElementsByClassName('js-calendar-graph-svg')[0];
var days = [].slice.call(graph.getElementsByTagName('rect'), 0);

days.forEach(function(rect) {
    switch(rect.getAttribute('fill').toUpperCase()) {
        case GH[0]: rect.setAttribute('fill', CO[2]); break; // yellow
        case GH[1]: rect.setAttribute('fill', CO[Math.floor(Math.random() * 2)]); break; // red || orange
        case GH[2]: rect.setAttribute('fill', CO[3]); break; // green
        case GH[3]: rect.setAttribute('fill', CO[4]); break; // blue
        case GH[4]: rect.setAttribute('fill', CO[5]); break; // purple
    }
});

Copyright © 2005 - 2017 Colin Seymour All rights reserved. Privacy Policy.
Check out the feed if you do the RSS/Atom thing.