2b0797f50f
Linked colors to options menu Options extension Aussehen aufgebohrt: - erlaubt text von status zu ändern, - bessere beschriftung von Farben desing änderung und bedienung - heute status felder anklickbar, - Farbpalette verdunkelt und kontrast reduziert - Kalender Tage anklickbar gemacht - Optionen überarbeitet
23 lines
650 B
C#
23 lines
650 B
C#
using Microsoft.Maui.Controls;
|
|
using Microsoft.Maui.Graphics;
|
|
|
|
namespace cfs_tracker.Helpers;
|
|
|
|
public static class ThemeResourceHelper
|
|
{
|
|
public static Color GetColor(string key, string fallbackHex = "#FFFFFF")
|
|
{
|
|
if (Application.Current?.Resources.TryGetValue(key, out var value) == true && value is Color color)
|
|
return color;
|
|
|
|
return Color.FromArgb(fallbackHex);
|
|
}
|
|
|
|
public static string GetString(string key, string fallback = "")
|
|
{
|
|
if (Application.Current?.Resources.TryGetValue(key, out var value) == true && value is string text)
|
|
return text;
|
|
|
|
return fallback;
|
|
}
|
|
} |