-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(theme): fix cards background of blur theme
- Loading branch information
Alexander Zhukov
committed
Feb 3, 2017
1 parent
a5a1faf
commit 0528e2e
Showing
5 changed files
with
91 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,95 @@ | ||
import {Injectable} from '@angular/core'; | ||
import {colorHelper} from './theme.constants'; | ||
import { Injectable } from '@angular/core'; | ||
import * as _ from 'lodash'; | ||
|
||
import { colorHelper } from './theme.constants'; | ||
|
||
@Injectable() | ||
export class BaThemeConfigProvider { | ||
|
||
basic = { | ||
default: '#ffffff', | ||
defaultText: '#ffffff', | ||
border: '#dddddd', | ||
borderDark: '#aaaaaa', | ||
}; | ||
private basic: any; | ||
private colorScheme: any; | ||
private dashboardColors: any; | ||
private conf: any; | ||
|
||
// main functional color scheme | ||
colorScheme = { | ||
primary: '#00abff', | ||
info: '#40daf1', | ||
success: '#8bd22f', | ||
warning: '#e7ba08', | ||
danger: '#f95372', | ||
}; | ||
constructor() { | ||
this.basic = { | ||
default: '#ffffff', | ||
defaultText: '#ffffff', | ||
border: '#dddddd', | ||
borderDark: '#aaaaaa', | ||
}; | ||
|
||
// dashboard colors for charts | ||
dashboardColors = { | ||
blueStone: '#40daf1', | ||
surfieGreen: '#00abff', | ||
silverTree: '#1b70ef', | ||
gossip: '#3c4eb9', | ||
white: '#ffffff', | ||
}; | ||
// main functional color scheme | ||
this.colorScheme = { | ||
primary: '#00abff', | ||
info: '#40daf1', | ||
success: '#8bd22f', | ||
warning: '#e7ba08', | ||
danger: '#f95372', | ||
}; | ||
|
||
conf = { | ||
theme: { | ||
name: 'ng2', | ||
}, | ||
colors: { | ||
default: this.basic.default, | ||
defaultText: this.basic.defaultText, | ||
border: this.basic.border, | ||
borderDark: this.basic.borderDark, | ||
// dashboard colors for charts | ||
this.dashboardColors = { | ||
blueStone: '#40daf1', | ||
surfieGreen: '#00abff', | ||
silverTree: '#1b70ef', | ||
gossip: '#3c4eb9', | ||
white: '#ffffff', | ||
}; | ||
|
||
primary: this.colorScheme.primary, | ||
info: this.colorScheme.info, | ||
success: this.colorScheme.success, | ||
warning: this.colorScheme.warning, | ||
danger: this.colorScheme.danger, | ||
this.conf = { | ||
theme: { | ||
name: 'ng2', | ||
}, | ||
colors: { | ||
default: this.basic.default, | ||
defaultText: this.basic.defaultText, | ||
border: this.basic.border, | ||
borderDark: this.basic.borderDark, | ||
|
||
primaryLight: colorHelper.tint(this.colorScheme.primary, 30), | ||
infoLight: colorHelper.tint(this.colorScheme.info, 30), | ||
successLight: colorHelper.tint(this.colorScheme.success, 30), | ||
warningLight: colorHelper.tint(this.colorScheme.warning, 30), | ||
dangerLight: colorHelper.tint(this.colorScheme.danger, 30), | ||
primary: this.colorScheme.primary, | ||
info: this.colorScheme.info, | ||
success: this.colorScheme.success, | ||
warning: this.colorScheme.warning, | ||
danger: this.colorScheme.danger, | ||
|
||
primaryDark: colorHelper.shade(this.colorScheme.primary, 15), | ||
infoDark: colorHelper.shade(this.colorScheme.info, 15), | ||
successDark: colorHelper.shade(this.colorScheme.success, 15), | ||
warningDark: colorHelper.shade(this.colorScheme.warning, 15), | ||
dangerDark: colorHelper.shade(this.colorScheme.danger, 15), | ||
primaryLight: colorHelper.tint(this.colorScheme.primary, 30), | ||
infoLight: colorHelper.tint(this.colorScheme.info, 30), | ||
successLight: colorHelper.tint(this.colorScheme.success, 30), | ||
warningLight: colorHelper.tint(this.colorScheme.warning, 30), | ||
dangerLight: colorHelper.tint(this.colorScheme.danger, 30), | ||
|
||
dashboard: { | ||
blueStone: this.dashboardColors.blueStone, | ||
surfieGreen: this.dashboardColors.surfieGreen, | ||
silverTree: this.dashboardColors.silverTree, | ||
gossip: this.dashboardColors.gossip, | ||
white: this.dashboardColors.white, | ||
}, | ||
primaryDark: colorHelper.shade(this.colorScheme.primary, 15), | ||
infoDark: colorHelper.shade(this.colorScheme.info, 15), | ||
successDark: colorHelper.shade(this.colorScheme.success, 15), | ||
warningDark: colorHelper.shade(this.colorScheme.warning, 15), | ||
dangerDark: colorHelper.shade(this.colorScheme.danger, 15), | ||
|
||
custom: { | ||
dashboardLineChart: this.basic.defaultText, | ||
dashboardPieChart: colorHelper.hexToRgbA(this.basic.defaultText, 0.8) | ||
dashboard: { | ||
blueStone: this.dashboardColors.blueStone, | ||
surfieGreen: this.dashboardColors.surfieGreen, | ||
silverTree: this.dashboardColors.silverTree, | ||
gossip: this.dashboardColors.gossip, | ||
white: this.dashboardColors.white, | ||
}, | ||
|
||
custom: { | ||
dashboardPieChart: colorHelper.hexToRgbA(this.basic.defaultText, 0.8), | ||
dashboardLineChart: this.basic.defaultText, | ||
} | ||
} | ||
} | ||
}; | ||
}; | ||
} | ||
|
||
get() { | ||
return this.conf; | ||
} | ||
|
||
changeTheme (theme) { | ||
changeTheme(theme: any) { | ||
_.merge(this.get().theme, theme); | ||
} | ||
|
||
changeColors (colors) { | ||
changeColors(colors: any) { | ||
_.merge(this.get().colors, colors); | ||
} | ||
} |