@mayahq/maya-red-dashboard
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -14,3 +14,3 @@ module.exports = function(RED) { | ||
var defaultLightTheme = { | ||
baseColor: '#0094CE', | ||
baseColor: '#805AD5', | ||
baseFont: baseFontName | ||
@@ -41,3 +41,3 @@ } | ||
if (typeof(config.theme) === 'string') { themeName = config.theme; } | ||
else { themeName = config.theme.name || "theme-light"; } | ||
else { themeName = config.theme.name || "theme-dark"; } | ||
@@ -48,11 +48,11 @@ // Setup other styles | ||
defaultThemeState["base-font"] = {value: baseFontName}; | ||
defaultThemeState["base-color"] = {value: "#0094CE"}; | ||
defaultThemeState["base-color"] = {value: "#805AD5"}; | ||
defaultThemeState["page-backgroundColor"] = {value: "#fafafa"}; | ||
defaultThemeState["page-titlebar-backgroundColor"] = {value: "#0094CE"}; | ||
defaultThemeState["page-titlebar-backgroundColor"] = {value: "#805AD5"}; | ||
defaultThemeState["page-sidebar-backgroundColor"] = {value: "#ffffff"}; | ||
defaultThemeState["group-backgroundColor"] = {value: "#ffffff"}; | ||
defaultThemeState["group-textColor"] = {value: "#000000"}; | ||
defaultThemeState["group-textColor"] = {value: "#ffffff"}; | ||
defaultThemeState["group-borderColor"] = {value: "#ffffff"}; | ||
defaultThemeState["widget-textColor"] = {value: "#111111"}; | ||
defaultThemeState["widget-backgroundColor"] = {value: "#0094CE"}; | ||
defaultThemeState["widget-textColor"] = {value: "#ffffff"}; | ||
defaultThemeState["widget-backgroundColor"] = {value: "#805AD5"}; | ||
} | ||
@@ -63,3 +63,3 @@ else { | ||
defaultThemeState["page-backgroundColor"] = {value: "#111111"}; | ||
defaultThemeState["page-titlebar-backgroundColor"] = {value: "805AD5"}; | ||
defaultThemeState["page-titlebar-backgroundColor"] = {value: "#805AD5"}; | ||
defaultThemeState["page-sidebar-backgroundColor"] = {value: "#333333"}; | ||
@@ -70,3 +70,3 @@ defaultThemeState["group-backgroundColor"] = {value: "#333333"}; | ||
defaultThemeState["widget-textColor"] = {value: "#eeeeee"}; | ||
defaultThemeState["widget-backgroundColor"] = {value: "805AD5"}; | ||
defaultThemeState["widget-backgroundColor"] = {value: "#805AD5"}; | ||
} | ||
@@ -83,2 +83,4 @@ | ||
console.log(config.themeState) | ||
this.config = { | ||
@@ -85,0 +87,0 @@ theme: defaultThemeObject, |
{ | ||
"name": "@mayahq/maya-red-dashboard", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A set of dashboard nodes for Node-RED", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -18,4 +18,5 @@ # maya-red-dashboard | ||
![Dashboard example](http://nodered.org/images/dashboarde.png) | ||
![image](https://user-images.githubusercontent.com/8736797/138183713-c7992c28-dced-4f7d-be54-0120fd059c84.png) | ||
## Pre-requisites | ||
@@ -22,0 +23,0 @@ |
27
ui.js
@@ -622,15 +622,16 @@ | ||
function isDark() { | ||
if (baseConfiguration && baseConfiguration.site && baseConfiguration.site.allowTempTheme && baseConfiguration.site.allowTempTheme === "none") { | ||
if (baseConfiguration && baseConfiguration.hasOwnProperty("theme") && baseConfiguration.theme.hasOwnProperty("angularTheme")) { | ||
if (baseConfiguration.theme.angularTheme && baseConfiguration.theme.angularTheme.palette && baseConfiguration.theme.angularTheme.palette === "dark") { return true;} | ||
} | ||
return false; | ||
} | ||
else if (baseConfiguration && baseConfiguration.hasOwnProperty("theme") && baseConfiguration.theme.hasOwnProperty("themeState")) { | ||
var rgb = parseInt(baseConfiguration.theme.themeState["page-backgroundColor"].value.substring(1), 16); | ||
var luma = 0.2126 * ((rgb >> 16) & 0xff) + 0.7152 * ((rgb >> 8) & 0xff) + 0.0722 * ((rgb >> 0) & 0xff); // per ITU-R BT.709 | ||
if (luma > 128) { return false; } | ||
else { return true; } | ||
} | ||
else { return false; } // if in doubt - let's say it's light. | ||
// if (baseConfiguration && baseConfiguration.site && baseConfiguration.site.allowTempTheme && baseConfiguration.site.allowTempTheme === "none") { | ||
// if (baseConfiguration && baseConfiguration.hasOwnProperty("theme") && baseConfiguration.theme.hasOwnProperty("angularTheme")) { | ||
// if (baseConfiguration.theme.angularTheme && baseConfiguration.theme.angularTheme.palette && baseConfiguration.theme.angularTheme.palette === "dark") { return true;} | ||
// } | ||
// return false; | ||
// } | ||
// else if (baseConfiguration && baseConfiguration.hasOwnProperty("theme") && baseConfiguration.theme.hasOwnProperty("themeState")) { | ||
// var rgb = parseInt(baseConfiguration.theme.themeState["page-backgroundColor"].value.substring(1), 16); | ||
// var luma = 0.2126 * ((rgb >> 16) & 0xff) + 0.7152 * ((rgb >> 8) & 0xff) + 0.0722 * ((rgb >> 0) & 0xff); // per ITU-R BT.709 | ||
// if (luma > 128) { return false; } | ||
// else { return true; } | ||
// } | ||
// else { return false; } // if in doubt - let's say it's light. | ||
return true | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4339831
37393
306