From 5c19c72e3df5779c48f5b2cfb9acde62c17da005 Mon Sep 17 00:00:00 2001 From: Lee Berg Date: Wed, 25 Sep 2019 20:07:07 -0500 Subject: [PATCH 1/2] Collapsible Fix, Add Transparent to DashboardColor --- .../Scripts/collapsible.ps1 | 2 +- src/UniversalDashboard/Models/DashboardColor.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/UniversalDashboard.Materialize/Scripts/collapsible.ps1 b/src/UniversalDashboard.Materialize/Scripts/collapsible.ps1 index 6d6a3bfc..66f683a4 100644 --- a/src/UniversalDashboard.Materialize/Scripts/collapsible.ps1 +++ b/src/UniversalDashboard.Materialize/Scripts/collapsible.ps1 @@ -5,7 +5,7 @@ function New-UDCollapsible { [Parameter(Mandatory = $true, Position = 0)] [ScriptBlock]$Items, [Parameter()] - [UniversalDashboard.Models.DashboardColor]$BackgroundColor = 'White', + [UniversalDashboard.Models.DashboardColor]$BackgroundColor = 'Transparent', [Parameter()] [UniversalDashboard.Models.DashboardColor]$FontColor = 'Black', [Parameter()] diff --git a/src/UniversalDashboard/Models/DashboardColor.cs b/src/UniversalDashboard/Models/DashboardColor.cs index de1712da..072ef5a2 100644 --- a/src/UniversalDashboard/Models/DashboardColor.cs +++ b/src/UniversalDashboard/Models/DashboardColor.cs @@ -58,6 +58,14 @@ public static DashboardColor Parse(string hexOrName) return new DashboardColor(iColorInt); } + else if (hexOrName.Equals("Transparent")) + { + var color = Color.FromArgb(0, 0, 0, 0); + + log.Debug($"Parse - color = {color}"); + + return new DashboardColor(color); + } else { var color = Color.FromName(hexOrName); From 0e46192c18362f7a65df096ce4a23bc0c110ac36 Mon Sep 17 00:00:00 2001 From: Lee Berg Date: Wed, 25 Sep 2019 20:14:49 -0500 Subject: [PATCH 2/2] ToLowerTheTransparent --- src/UniversalDashboard/Models/DashboardColor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UniversalDashboard/Models/DashboardColor.cs b/src/UniversalDashboard/Models/DashboardColor.cs index 072ef5a2..e41f0ce9 100644 --- a/src/UniversalDashboard/Models/DashboardColor.cs +++ b/src/UniversalDashboard/Models/DashboardColor.cs @@ -58,7 +58,7 @@ public static DashboardColor Parse(string hexOrName) return new DashboardColor(iColorInt); } - else if (hexOrName.Equals("Transparent")) + else if ((hexOrName.ToLower()).Equals("transparent")) { var color = Color.FromArgb(0, 0, 0, 0);