fix(dashboard): use color from constants for pie charts

pull/46/head
KostyaDanovsky 2016-05-06 20:10:01 +03:00 committed by kostya.danovsky
parent a3a289b9ca
commit d54a39deeb
2 changed files with 8 additions and 3 deletions

View File

@ -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',

View File

@ -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 + ')';
}
}
})();