diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a21be10 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +chrome.zip diff --git a/chrome/iso.js b/chrome/iso.js index c346aa0..56dd406 100644 --- a/chrome/iso.js +++ b/chrome/iso.js @@ -71,13 +71,6 @@ function renderIsometricChart() { var point = new obelisk.Point(87, 100); var pixelView = new obelisk.PixelView(canvas, point); - var color; - var color0 = new obelisk.CubeColor().getByHorizontalColor(0xeeeeee); - var color1 = new obelisk.CubeColor().getByHorizontalColor(0xd6e685); - var color2 = new obelisk.CubeColor().getByHorizontalColor(0x8cc665); - var color3 = new obelisk.CubeColor().getByHorizontalColor(0x44a340); - var color4 = new obelisk.CubeColor().getByHorizontalColor(0x1e6823); - var maxContributions = $('.js-calendar-graph').data("max-contributions"); var contribCount; @@ -91,14 +84,9 @@ function renderIsometricChart() { var dimension = new obelisk.CubeDimension(SIZE, SIZE, parseInt(MAX_HEIGHT/maxContributions * contribCount) + 3); - if (style == 'fill: rgb(238, 238, 238);') color = color0; - else if (style == 'fill: rgb(214, 230, 133);') color = color1; - else if (style == 'fill: rgb(140, 198, 101);') color = color2; - else if (style == 'fill: rgb(68, 163, 64);') color = color3; - else if (style == 'fill: rgb(30, 104, 35);') color = color4; - - var cube = new obelisk.Cube(dimension, color, false); - var p3d = new obelisk.Point3D(SIZE * x, SIZE * y, 0); + var color = getSquareColor(style); + var cube = new obelisk.Cube(dimension, color, false); + var p3d = new obelisk.Point3D(SIZE * x, SIZE * y, 0); pixelView.renderObject(cube, p3d); }); }); @@ -185,3 +173,21 @@ function loadStats() { $('