Skip to content

Commit

Permalink
fix(dashboard): use color from constants for pie charts
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaDanovsky committed May 13, 2016
1 parent a3a289b commit d54a39d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
.controller('DashboardPieChartCtrl', DashboardPieChartCtrl);

/** @ngInject */
function DashboardPieChartCtrl($scope, $timeout, layoutColors) {
var pieColor = 'rgba(255, 255, 255, 0.4)';
function DashboardPieChartCtrl($scope, $timeout, layoutColors, baUtil) {
var pieColor = baUtil.hexToRGB(layoutColors.defaultText, 0.2);
$scope.charts = [{
color: pieColor,
description: 'New Visits',
Expand Down
7 changes: 6 additions & 1 deletion src/app/theme/services/baUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
return false;
};

this.hexToRGB = function(hex, alpha) {
var r = parseInt( hex.slice(1,3), 16 );
var g = parseInt( hex.slice(3,5), 16 );
var b = parseInt( hex.slice(5,7), 16 );
return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + alpha + ')';
}
}

})();

0 comments on commit d54a39d

Please sign in to comment.