mirror of https://github.com/akveo/blur-admin
fix(dashboard): use color from constants for pie charts
parent
a3a289b9ca
commit
d54a39deeb
|
@ -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',
|
||||
|
|
|
@ -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 + ')';
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue