| | | 1 | | namespace Allyaria.Theming.BrandTypes; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents a set of brand theme variants supporting both light and dark modes, as well as their derived inverse colo |
| | | 5 | | /// variants for adaptive contrast and visual harmony. |
| | | 6 | | /// </summary> |
| | | 7 | | public sealed record BrandVariant |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Initializes a new instance of the <see cref="BrandVariant" /> struct using optional light and dark themes. If no |
| | | 11 | | /// provided, default Allyaria color schemes are used. |
| | | 12 | | /// </summary> |
| | | 13 | | /// <param name="lightTheme">The light mode <see cref="BrandTheme" /> to apply. Defaults to a standard light theme i |
| | | 14 | | /// <param name="darkTheme">The dark mode <see cref="BrandTheme" /> to apply. Defaults to a standard dark theme if n |
| | 153 | 15 | | public BrandVariant(BrandTheme? lightTheme = null, BrandTheme? darkTheme = null) |
| | | 16 | | { |
| | 153 | 17 | | Dark = darkTheme ?? new BrandTheme( |
| | 153 | 18 | | surface: StyleDefaults.SurfaceColorDark, |
| | 153 | 19 | | primary: StyleDefaults.PrimaryColorDark, |
| | 153 | 20 | | secondary: StyleDefaults.SecondaryColorDark, |
| | 153 | 21 | | tertiary: StyleDefaults.TertiaryColorDark, |
| | 153 | 22 | | error: StyleDefaults.ErrorColorDark, |
| | 153 | 23 | | warning: StyleDefaults.WarningColorDark, |
| | 153 | 24 | | success: StyleDefaults.SuccessColorDark, |
| | 153 | 25 | | info: StyleDefaults.InfoColorDark |
| | 153 | 26 | | ); |
| | | 27 | | |
| | 153 | 28 | | DarkVariant = new BrandTheme( |
| | 153 | 29 | | surface: Dark.Surface.Default.ForegroundColor, |
| | 153 | 30 | | primary: Dark.Primary.Default.ForegroundColor, |
| | 153 | 31 | | secondary: Dark.Secondary.Default.ForegroundColor, |
| | 153 | 32 | | tertiary: Dark.Tertiary.Default.ForegroundColor, |
| | 153 | 33 | | error: Dark.Error.Default.ForegroundColor, |
| | 153 | 34 | | warning: Dark.Warning.Default.ForegroundColor, |
| | 153 | 35 | | success: Dark.Success.Default.ForegroundColor, |
| | 153 | 36 | | info: Dark.Info.Default.ForegroundColor |
| | 153 | 37 | | ); |
| | | 38 | | |
| | 153 | 39 | | Light = lightTheme ?? new BrandTheme( |
| | 153 | 40 | | surface: StyleDefaults.SurfaceColorLight, |
| | 153 | 41 | | primary: StyleDefaults.PrimaryColorLight, |
| | 153 | 42 | | secondary: StyleDefaults.SecondaryColorLight, |
| | 153 | 43 | | tertiary: StyleDefaults.TertiaryColorLight, |
| | 153 | 44 | | error: StyleDefaults.ErrorColorLight, |
| | 153 | 45 | | warning: StyleDefaults.WarningColorLight, |
| | 153 | 46 | | success: StyleDefaults.SuccessColorLight, |
| | 153 | 47 | | info: StyleDefaults.InfoColorLight |
| | 153 | 48 | | ); |
| | | 49 | | |
| | 153 | 50 | | LightVariant = new BrandTheme( |
| | 153 | 51 | | surface: Light.Surface.Default.ForegroundColor, |
| | 153 | 52 | | primary: Light.Primary.Default.ForegroundColor, |
| | 153 | 53 | | secondary: Light.Secondary.Default.ForegroundColor, |
| | 153 | 54 | | tertiary: Light.Tertiary.Default.ForegroundColor, |
| | 153 | 55 | | error: Light.Error.Default.ForegroundColor, |
| | 153 | 56 | | warning: Light.Warning.Default.ForegroundColor, |
| | 153 | 57 | | success: Light.Success.Default.ForegroundColor, |
| | 153 | 58 | | info: Light.Info.Default.ForegroundColor |
| | 153 | 59 | | ); |
| | 153 | 60 | | } |
| | | 61 | | |
| | | 62 | | /// <summary>Gets the primary dark theme configuration.</summary> |
| | 1489 | 63 | | public BrandTheme Dark { get; } |
| | | 64 | | |
| | | 65 | | /// <summary> |
| | | 66 | | /// Gets the dark variant theme, created by inverting or adapting the foreground colors of the dark theme. |
| | | 67 | | /// </summary> |
| | 144 | 68 | | public BrandTheme DarkVariant { get; } |
| | | 69 | | |
| | | 70 | | /// <summary>Gets the primary light theme configuration.</summary> |
| | 1489 | 71 | | public BrandTheme Light { get; } |
| | | 72 | | |
| | | 73 | | /// <summary> |
| | | 74 | | /// Gets the light variant theme, created by inverting or adapting the foreground colors of the light theme. |
| | | 75 | | /// </summary> |
| | 144 | 76 | | public BrandTheme LightVariant { get; } |
| | | 77 | | } |