Derive header action button colors from dynamic header color
This commit is contained in:
@@ -281,7 +281,7 @@
|
|||||||
Value="True">
|
Value="True">
|
||||||
<Setter TargetName="HeaderButtonBorder"
|
<Setter TargetName="HeaderButtonBorder"
|
||||||
Property="Background"
|
Property="Background"
|
||||||
Value="{DynamicResource inactiveButtonColor}" />
|
Value="{DynamicResource headerControlHoverBackgroundColor}" />
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed"
|
<Trigger Property="IsPressed"
|
||||||
Value="True">
|
Value="True">
|
||||||
@@ -300,7 +300,7 @@
|
|||||||
<Setter Property="BorderThickness"
|
<Setter Property="BorderThickness"
|
||||||
Value="0" />
|
Value="0" />
|
||||||
<Setter Property="Background"
|
<Setter Property="Background"
|
||||||
Value="Transparent" />
|
Value="{DynamicResource headerControlBackgroundColor}" />
|
||||||
<Setter Property="Width"
|
<Setter Property="Width"
|
||||||
Value="32" />
|
Value="32" />
|
||||||
<Setter Property="Height"
|
<Setter Property="Height"
|
||||||
|
|||||||
@@ -253,6 +253,16 @@ namespace C4IT_CustomerPanel.libs
|
|||||||
Application.Current.Resources["navigationRailBorderColor"] = new SolidColorBrush(navBorder);
|
Application.Current.Resources["navigationRailBorderColor"] = new SolidColorBrush(navBorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void ApplyHeaderDerivedResources(Color headerColor)
|
||||||
|
{
|
||||||
|
bool isLightHeader = GetRelativeLuminance(headerColor) >= 0.55;
|
||||||
|
Color controlBase = BlendColor(headerColor, isLightHeader ? Colors.Black : Colors.White, isLightHeader ? 0.14 : 0.18);
|
||||||
|
Color controlHover = BlendColor(headerColor, isLightHeader ? Colors.Black : Colors.White, isLightHeader ? 0.22 : 0.26);
|
||||||
|
|
||||||
|
Application.Current.Resources["headerControlBackgroundColor"] = new SolidColorBrush(controlBase);
|
||||||
|
Application.Current.Resources["headerControlHoverBackgroundColor"] = new SolidColorBrush(controlHover);
|
||||||
|
}
|
||||||
|
|
||||||
public SolidColorBrush GetHeaderColor()
|
public SolidColorBrush GetHeaderColor()
|
||||||
{
|
{
|
||||||
return (SolidColorBrush)System.Windows.Application.Current.Resources["headerColor"];
|
return (SolidColorBrush)System.Windows.Application.Current.Resources["headerColor"];
|
||||||
@@ -995,6 +1005,7 @@ namespace C4IT_CustomerPanel.libs
|
|||||||
|
|
||||||
System.Windows.Application.Current.Resources["headerColor"] = new SolidColorBrush(headerColor);
|
System.Windows.Application.Current.Resources["headerColor"] = new SolidColorBrush(headerColor);
|
||||||
ApplyBackgroundDerivedResources(backgroundColor);
|
ApplyBackgroundDerivedResources(backgroundColor);
|
||||||
|
ApplyHeaderDerivedResources(headerColor);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -1008,6 +1019,7 @@ namespace C4IT_CustomerPanel.libs
|
|||||||
|
|
||||||
System.Windows.Application.Current.Resources["headerColor"] = new SolidColorBrush(fallbackHeader);
|
System.Windows.Application.Current.Resources["headerColor"] = new SolidColorBrush(fallbackHeader);
|
||||||
ApplyBackgroundDerivedResources(fallbackBackground);
|
ApplyBackgroundDerivedResources(fallbackBackground);
|
||||||
|
ApplyHeaderDerivedResources(fallbackHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<SolidColorBrush x:Key="buttonTextColor" Color="#E2E8F0"></SolidColorBrush>
|
<SolidColorBrush x:Key="buttonTextColor" Color="#E2E8F0"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="headerColor" Color="#0B1220"></SolidColorBrush>
|
<SolidColorBrush x:Key="headerColor" Color="#0B1220"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="headerControlBackgroundColor" Color="#233550"></SolidColorBrush>
|
<SolidColorBrush x:Key="headerControlBackgroundColor" Color="#233550"></SolidColorBrush>
|
||||||
|
<SolidColorBrush x:Key="headerControlHoverBackgroundColor" Color="#31496B"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="backgroundColor" Color="#0F172A"></SolidColorBrush>
|
<SolidColorBrush x:Key="backgroundColor" Color="#0F172A"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="panelBackgroundColor" Color="#0F172A"></SolidColorBrush>
|
<SolidColorBrush x:Key="panelBackgroundColor" Color="#0F172A"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="panelBorderColor" Color="#2A3F5F"></SolidColorBrush>
|
<SolidColorBrush x:Key="panelBorderColor" Color="#2A3F5F"></SolidColorBrush>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<SolidColorBrush x:Key="buttonTextColor" Color="#0F172A"></SolidColorBrush>
|
<SolidColorBrush x:Key="buttonTextColor" Color="#0F172A"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="headerColor" Color="#EAF1FA"></SolidColorBrush>
|
<SolidColorBrush x:Key="headerColor" Color="#EAF1FA"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="headerControlBackgroundColor" Color="#C8D6EA"></SolidColorBrush>
|
<SolidColorBrush x:Key="headerControlBackgroundColor" Color="#C8D6EA"></SolidColorBrush>
|
||||||
|
<SolidColorBrush x:Key="headerControlHoverBackgroundColor" Color="#B2C5DE"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="backgroundColor" Color="#EDF3FB"></SolidColorBrush>
|
<SolidColorBrush x:Key="backgroundColor" Color="#EDF3FB"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="panelBackgroundColor" Color="#EDF3FB"></SolidColorBrush>
|
<SolidColorBrush x:Key="panelBackgroundColor" Color="#EDF3FB"></SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="panelBorderColor" Color="#CAD9EC"></SolidColorBrush>
|
<SolidColorBrush x:Key="panelBorderColor" Color="#CAD9EC"></SolidColorBrush>
|
||||||
|
|||||||
Reference in New Issue
Block a user