| | | 1 | | namespace Allyaria.Theming.BrandTypes; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents a comprehensive theme configuration for a brand, containing multiple color states across different tonal |
| | | 5 | | /// elevations and semantic categories such as primary, secondary, error, success, and warning. |
| | | 6 | | /// </summary> |
| | | 7 | | public sealed record BrandTheme |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Initializes a new instance of the <see cref="BrandTheme" /> struct using the provided color parameters. |
| | | 11 | | /// </summary> |
| | | 12 | | /// <param name="surface"> |
| | | 13 | | /// The base surface <see cref="HexColor" /> for the theme. Defaults to <see cref="StyleDefaults.SurfaceColorLight" |
| | | 14 | | /// null. |
| | | 15 | | /// </param> |
| | | 16 | | /// <param name="primary"> |
| | | 17 | | /// The primary <see cref="HexColor" /> used for key actions or highlights. Defaults to |
| | | 18 | | /// <see cref="StyleDefaults.PrimaryColorLight" /> if null. |
| | | 19 | | /// </param> |
| | | 20 | | /// <param name="secondary"> |
| | | 21 | | /// The secondary <see cref="HexColor" /> used for supporting accents. Defaults to |
| | | 22 | | /// <see cref="StyleDefaults.SecondaryColorLight" /> if null. |
| | | 23 | | /// </param> |
| | | 24 | | /// <param name="tertiary"> |
| | | 25 | | /// The tertiary <see cref="HexColor" /> used for subtle UI accents. Defaults to |
| | | 26 | | /// <see cref="StyleDefaults.TertiaryColorLight" /> if null. |
| | | 27 | | /// </param> |
| | | 28 | | /// <param name="error"> |
| | | 29 | | /// The error <see cref="HexColor" /> used for failure or validation states. Defaults to |
| | | 30 | | /// <see cref="StyleDefaults.ErrorColorLight" /> if null. |
| | | 31 | | /// </param> |
| | | 32 | | /// <param name="warning"> |
| | | 33 | | /// The warning <see cref="HexColor" /> used for cautionary states. Defaults to |
| | | 34 | | /// <see cref="StyleDefaults.WarningColorLight" /> if null. |
| | | 35 | | /// </param> |
| | | 36 | | /// <param name="success"> |
| | | 37 | | /// The success <see cref="HexColor" /> used for confirmation or positive states. Defaults to |
| | | 38 | | /// <see cref="StyleDefaults.SuccessColorLight" /> if null. |
| | | 39 | | /// </param> |
| | | 40 | | /// <param name="info"> |
| | | 41 | | /// The info <see cref="HexColor" /> used for informational states. Defaults to <see cref="StyleDefaults.InfoColorLi |
| | | 42 | | /// if null. |
| | | 43 | | /// </param> |
| | 616 | 44 | | public BrandTheme(HexColor? surface = null, |
| | 616 | 45 | | HexColor? primary = null, |
| | 616 | 46 | | HexColor? secondary = null, |
| | 616 | 47 | | HexColor? tertiary = null, |
| | 616 | 48 | | HexColor? error = null, |
| | 616 | 49 | | HexColor? warning = null, |
| | 616 | 50 | | HexColor? success = null, |
| | 616 | 51 | | HexColor? info = null) |
| | | 52 | | { |
| | 616 | 53 | | Elevation1 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation1()); |
| | 616 | 54 | | Elevation2 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation2()); |
| | 616 | 55 | | Elevation3 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation3()); |
| | 616 | 56 | | Elevation4 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation4()); |
| | 616 | 57 | | Elevation5 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation5()); |
| | 616 | 58 | | Error = new BrandState(color: error ?? StyleDefaults.ErrorColorLight); |
| | 616 | 59 | | Info = new BrandState(color: info ?? StyleDefaults.InfoColorLight); |
| | 616 | 60 | | Primary = new BrandState(color: primary ?? StyleDefaults.PrimaryColorLight); |
| | 616 | 61 | | Success = new BrandState(color: success ?? StyleDefaults.SuccessColorLight); |
| | 616 | 62 | | Secondary = new BrandState(color: secondary ?? StyleDefaults.SecondaryColorLight); |
| | 616 | 63 | | Surface = new BrandState(color: surface ?? StyleDefaults.SurfaceColorLight); |
| | 616 | 64 | | Tertiary = new BrandState(color: tertiary ?? StyleDefaults.TertiaryColorLight); |
| | 616 | 65 | | Warning = new BrandState(color: warning ?? StyleDefaults.WarningColorLight); |
| | 616 | 66 | | } |
| | | 67 | | |
| | | 68 | | /// <summary>Gets the elevation level 1 color state, used for the lowest raised surfaces.</summary> |
| | 228 | 69 | | public BrandState Elevation1 { get; } |
| | | 70 | | |
| | | 71 | | /// <summary>Gets the elevation level 2 color state, used for slightly raised surfaces.</summary> |
| | 4 | 72 | | public BrandState Elevation2 { get; } |
| | | 73 | | |
| | | 74 | | /// <summary>Gets the elevation level 3 color state, used for medium-raised UI regions.</summary> |
| | 4 | 75 | | public BrandState Elevation3 { get; } |
| | | 76 | | |
| | | 77 | | /// <summary>Gets the elevation level 4 color state, representing higher-depth UI layers.</summary> |
| | 4 | 78 | | public BrandState Elevation4 { get; } |
| | | 79 | | |
| | | 80 | | /// <summary>Gets the elevation level 5 color state, representing the highest raised surfaces.</summary> |
| | 4 | 81 | | public BrandState Elevation5 { get; } |
| | | 82 | | |
| | | 83 | | /// <summary>Gets the color state representing error or critical feedback visuals.</summary> |
| | 324 | 84 | | public BrandState Error { get; } |
| | | 85 | | |
| | | 86 | | /// <summary>Gets the color state representing informational messages or neutral alerts.</summary> |
| | 312 | 87 | | public BrandState Info { get; } |
| | | 88 | | |
| | | 89 | | /// <summary>Gets the primary color state used for dominant elements such as buttons or links.</summary> |
| | 540 | 90 | | public BrandState Primary { get; } |
| | | 91 | | |
| | | 92 | | /// <summary>Gets the secondary color state used for complementary or background highlights.</summary> |
| | 340 | 93 | | public BrandState Secondary { get; } |
| | | 94 | | |
| | | 95 | | /// <summary>Gets the success color state used for positive confirmations.</summary> |
| | 312 | 96 | | public BrandState Success { get; } |
| | | 97 | | |
| | | 98 | | /// <summary>Gets the surface color state used as the base layer for background regions.</summary> |
| | 592 | 99 | | public BrandState Surface { get; } |
| | | 100 | | |
| | | 101 | | /// <summary>Gets the tertiary color state used for subtle or decorative accents.</summary> |
| | 312 | 102 | | public BrandState Tertiary { get; } |
| | | 103 | | |
| | | 104 | | /// <summary>Gets the warning color state used for cautionary alerts or partial issues.</summary> |
| | 312 | 105 | | public BrandState Warning { get; } |
| | | 106 | | } |