2016-04-26 17:44:17 +03:00
|
|
|
export const IMAGES_ROOT = 'assets/img/';
|
|
|
|
|
|
2016-05-03 14:33:28 +03:00
|
|
|
|
2016-05-16 17:08:43 +03:00
|
|
|
export class colorHelper {
|
|
|
|
|
static shade = (color, weight) => {
|
|
|
|
|
return mix('#000000', color, weight);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static tint = (color, weight) => {
|
|
|
|
|
return mix('#ffffff', color, weight);
|
|
|
|
|
};
|
|
|
|
|
}
|
2016-05-03 14:33:28 +03:00
|
|
|
|
|
|
|
|
//SASS mix function
|
|
|
|
|
export let mix = (color1, color2, weight) => {
|
|
|
|
|
// convert a decimal value to hex
|
|
|
|
|
function d2h(d) {
|
|
|
|
|
return d.toString(16);
|
|
|
|
|
}
|
2016-05-16 17:08:43 +03:00
|
|
|
|
2016-05-03 14:33:28 +03:00
|
|
|
// convert a hex value to decimal
|
|
|
|
|
function h2d(h) {
|
|
|
|
|
return parseInt(h, 16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let result = "#";
|
2016-05-16 17:08:43 +03:00
|
|
|
for (let i = 1; i < 7; i += 2) {
|
2016-05-03 14:33:28 +03:00
|
|
|
let color1Part = h2d(color1.substr(i, 2));
|
|
|
|
|
let color2Part = h2d(color2.substr(i, 2));
|
|
|
|
|
let resultPart = d2h(Math.floor(color2Part + (color1Part - color2Part) * (weight / 100.0)));
|
|
|
|
|
result += ('0' + resultPart).slice(-2);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export let hexToRgbA = (hex, alpha) => {
|
|
|
|
|
var c;
|
2016-05-16 17:08:43 +03:00
|
|
|
if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {
|
|
|
|
|
c = hex.substring(1).split('');
|
|
|
|
|
if (c.length == 3) {
|
|
|
|
|
c = [c[0], c[0], c[1], c[1], c[2], c[2]];
|
2016-05-03 14:33:28 +03:00
|
|
|
}
|
2016-05-16 17:08:43 +03:00
|
|
|
c = '0x' + c.join('');
|
|
|
|
|
return 'rgba(' + [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') + ',' + alpha + ')';
|
2016-05-03 14:33:28 +03:00
|
|
|
}
|
|
|
|
|
throw new Error('Bad Hex');
|
|
|
|
|
};
|
|
|
|
|
|
2016-04-28 17:52:30 +03:00
|
|
|
export const layoutSizes = {
|
|
|
|
|
resWidthCollapseSidebar: 1200,
|
|
|
|
|
resWidthHideSidebar: 500
|
|
|
|
|
};
|
|
|
|
|
|
2016-05-02 19:49:37 +03:00
|
|
|
export const colorScheme = {
|
|
|
|
|
primary: '#209e91',
|
|
|
|
|
info: '#2dacd1',
|
|
|
|
|
success: '#90b900',
|
|
|
|
|
warning: '#dfb81c',
|
|
|
|
|
danger: '#e85656',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const bgColorPalette = {
|
|
|
|
|
blueStone: '#005562',
|
|
|
|
|
surfieGreen: '#0e8174',
|
|
|
|
|
silverTree: '#6eba8c',
|
|
|
|
|
gossip: '#b9f2a1',
|
2016-05-16 16:30:56 +03:00
|
|
|
white: '#10c4b5',
|
2016-05-02 19:49:37 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const layoutColors = {
|
|
|
|
|
primary: colorScheme.primary,
|
|
|
|
|
info: colorScheme.info,
|
|
|
|
|
success: colorScheme.success,
|
|
|
|
|
warning: colorScheme.warning,
|
|
|
|
|
danger: colorScheme.danger,
|
|
|
|
|
|
2016-05-16 17:08:43 +03:00
|
|
|
primaryLight: colorHelper.tint(colorScheme.primary, 30),
|
|
|
|
|
infoLight: colorHelper.tint(colorScheme.info, 30),
|
|
|
|
|
successLight: colorHelper.tint(colorScheme.success, 30),
|
|
|
|
|
warningLight: colorHelper.tint(colorScheme.warning, 30),
|
|
|
|
|
dangerLight: colorHelper.tint(colorScheme.danger, 30),
|
2016-05-02 19:49:37 +03:00
|
|
|
|
2016-05-16 17:08:43 +03:00
|
|
|
primaryDark: colorHelper.shade(colorScheme.primary, 15),
|
|
|
|
|
infoDark: colorHelper.shade(colorScheme.info, 15),
|
|
|
|
|
successDark: colorHelper.shade(colorScheme.success, 15),
|
|
|
|
|
warningDark: colorHelper.shade(colorScheme.warning, 15),
|
|
|
|
|
dangerDark: colorHelper.shade(colorScheme.danger, 15),
|
2016-05-02 19:49:37 +03:00
|
|
|
|
2016-05-16 17:08:43 +03:00
|
|
|
primaryBg: colorHelper.tint(colorScheme.primary, 20),
|
|
|
|
|
infoBg: colorHelper.tint(colorScheme.info, 20),
|
|
|
|
|
successBg: colorHelper.tint(colorScheme.success, 20),
|
|
|
|
|
warningBg: colorHelper.tint(colorScheme.warning, 20),
|
|
|
|
|
dangerBg: colorHelper.tint(colorScheme.danger, 20),
|
2016-05-02 19:49:37 +03:00
|
|
|
|
|
|
|
|
default: '#ffffff',
|
2016-05-16 16:30:56 +03:00
|
|
|
defaultText: '#666666',
|
|
|
|
|
border: '#dddddd',
|
2016-05-02 19:49:37 +03:00
|
|
|
|
|
|
|
|
bgColorPalette: {
|
|
|
|
|
blueStone: bgColorPalette.blueStone,
|
|
|
|
|
surfieGreen: bgColorPalette.surfieGreen,
|
|
|
|
|
silverTree: bgColorPalette.silverTree,
|
|
|
|
|
gossip: bgColorPalette.gossip,
|
|
|
|
|
white: bgColorPalette.white,
|
|
|
|
|
|
2016-05-16 17:08:43 +03:00
|
|
|
blueStoneDark: colorHelper.shade(bgColorPalette.blueStone, 15),
|
|
|
|
|
surfieGreenDark: colorHelper.shade(bgColorPalette.surfieGreen, 15),
|
|
|
|
|
silverTreeDark: colorHelper.shade(bgColorPalette.silverTree, 15),
|
|
|
|
|
gossipDark: colorHelper.shade(bgColorPalette.gossip, 15),
|
|
|
|
|
whiteDark: colorHelper.shade(bgColorPalette.white, 5),
|
2016-05-02 19:49:37 +03:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2016-05-03 14:33:28 +03:00
|
|
|
let _chartColors = [];
|
2016-05-16 17:08:43 +03:00
|
|
|
let _colorsForChart = [layoutColors.primary, layoutColors.danger, layoutColors.warning, layoutColors.success, layoutColors.info, layoutColors.default, layoutColors.primaryDark, layoutColors.successDark, layoutColors.warningLight, layoutColors.successLight, layoutColors.successBg];
|
2016-05-03 14:33:28 +03:00
|
|
|
|
|
|
|
|
_colorsForChart.forEach((color) => {
|
|
|
|
|
_chartColors.push({
|
|
|
|
|
fillColor: hexToRgbA(color, 0.2),
|
|
|
|
|
strokeColor: hexToRgbA(color, 1),
|
|
|
|
|
pointColor: hexToRgbA(color, 1),
|
|
|
|
|
pointStrokeColor: color,
|
|
|
|
|
pointHighlightFill: color,
|
|
|
|
|
pointHighlightStroke: hexToRgbA(color, 0.8),
|
|
|
|
|
color: hexToRgbA(color, 1),
|
|
|
|
|
highlight: hexToRgbA(color, 0.8)
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
export const chartColors = _chartColors;
|
|
|
|
|
|
2016-04-26 17:44:17 +03:00
|
|
|
export const layoutPaths = {
|
|
|
|
|
images: {
|
|
|
|
|
root: IMAGES_ROOT,
|
|
|
|
|
profile: IMAGES_ROOT + 'app/profile/',
|
2016-05-02 19:49:37 +03:00
|
|
|
amMap: 'assets/img/theme/vendor/ammap/',
|
2016-04-26 17:44:17 +03:00
|
|
|
amChart: 'assets/img/theme/vendor/amcharts/dist/amcharts/images/'
|
|
|
|
|
}
|
|
|
|
|
};
|