From cddd016e5384397e24b3e95e81a7d3f72e4ffb7e Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 25 May 2022 13:35:27 -0400 Subject: [PATCH] fix(administration(js)): add rgba colors to theme preview --- UI/Templates/AdministrationUI/UIxThemePreview.wox | 11 ++++++++++- .../js/Administration/ThemePreviewController.js | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/UI/Templates/AdministrationUI/UIxThemePreview.wox b/UI/Templates/AdministrationUI/UIxThemePreview.wox index 3a22fb165..4a8420299 100644 --- a/UI/Templates/AdministrationUI/UIxThemePreview.wox +++ b/UI/Templates/AdministrationUI/UIxThemePreview.wox @@ -16,9 +16,18 @@

Palettes

Accessible from md-colors and $mdThemingProvider + +
+ {{ palette }} + {{ ctrl.defaultTheme.colors[palette].name }} +
+
+ {{ palette }}-{{ hex }} + md-colors="{backgroundColor: '{{ palette }}-{{ hex }}'}"> +
{{ palette }}-{{ hex }}
+
{{ ctrl.getColor(palette + '-' + hex) }}
diff --git a/UI/WebServerResources/js/Administration/ThemePreviewController.js b/UI/WebServerResources/js/Administration/ThemePreviewController.js index a83c50615..b72cdd425 100644 --- a/UI/WebServerResources/js/Administration/ThemePreviewController.js +++ b/UI/WebServerResources/js/Administration/ThemePreviewController.js @@ -25,10 +25,11 @@ /** * @ngInject */ - ThemePreviewController.$inject = ['$mdTheming']; - function ThemePreviewController($mdTheming) { + ThemePreviewController.$inject = ['$mdTheming', '$mdColors']; + function ThemePreviewController($mdTheming, $mdColors) { this.defaultTheme = $mdTheming.THEMES[$mdTheming.defaultTheme()]; this.jsonDefaultTheme = JSON.stringify(this.defaultTheme, undefined, 2); + this.getColor = $mdColors.getThemeColor; } angular