using UnityEngine; using UnityEngine.UIElements; namespace Kamgam.UIToolkitBlurredBackground { public static class BlurredBackgroundStyles { public static CustomStyleProperty Strength = new CustomStyleProperty("--blur-strength"); public static CustomStyleProperty Iterations = new CustomStyleProperty("--blur-iterations"); /// /// low, medium, high /// public static CustomStyleProperty Quality = new CustomStyleProperty("--blur-quality"); public static CustomStyleProperty Resolution = new CustomStyleProperty("--blur-resolution"); public static CustomStyleProperty Tint = new CustomStyleProperty("--blur-tint"); public static CustomStyleProperty MeshCornerOverlap = new CustomStyleProperty("--blur-mesh-corner-overlap"); public static CustomStyleProperty MeshCornerSegments = new CustomStyleProperty("--blur-mesh-corner-segments"); public static CustomStyleProperty BackgroundColor = new CustomStyleProperty("--blur-background-color"); public static float ResolveStyle(CustomStyleProperty property, VisualElement element, float defaultValue) { if (element.customStyle.TryGetValue(property, out var value)) { return value; } return defaultValue; } public static int ResolveStyle(CustomStyleProperty property, VisualElement element, int defaultValue) { if (element.customStyle.TryGetValue(property, out var value)) { return value; } return defaultValue; } public static bool ResolveStyle(CustomStyleProperty property, VisualElement element, bool defaultValue) { if (element.customStyle.TryGetValue(property, out var value)) { return value; } return defaultValue; } public static Color ResolveStyle(CustomStyleProperty property, VisualElement element, Color defaultValue) { if (element.customStyle.TryGetValue(property, out var value)) { return value; } return defaultValue; } public static string ResolveStyle(CustomStyleProperty property, VisualElement element, string defaultValue) { if (element.customStyle.TryGetValue(property, out var value)) { return value; } return defaultValue; } } }