< Summary

Information
Class: Allyaria.Theming.BrandTypes.BrandTheme
Assembly: Allyaria.Theming
File(s): /home/runner/work/allyaria/allyaria/src/Allyaria.Theming/BrandTypes/BrandTheme.cs
Line coverage
100%
Covered lines: 35
Uncovered lines: 0
Coverable lines: 35
Total lines: 106
Line coverage: 100%
Branch coverage
100%
Covered branches: 26
Total branches: 26
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%2626100%
get_Elevation1()100%11100%
get_Elevation2()100%11100%
get_Elevation3()100%11100%
get_Elevation4()100%11100%
get_Elevation5()100%11100%
get_Error()100%11100%
get_Info()100%11100%
get_Primary()100%11100%
get_Secondary()100%11100%
get_Success()100%11100%
get_Surface()100%11100%
get_Tertiary()100%11100%
get_Warning()100%11100%

File(s)

/home/runner/work/allyaria/allyaria/src/Allyaria.Theming/BrandTypes/BrandTheme.cs

#LineLine coverage
 1namespace 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>
 7public 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>
 61644    public BrandTheme(HexColor? surface = null,
 61645        HexColor? primary = null,
 61646        HexColor? secondary = null,
 61647        HexColor? tertiary = null,
 61648        HexColor? error = null,
 61649        HexColor? warning = null,
 61650        HexColor? success = null,
 61651        HexColor? info = null)
 52    {
 61653        Elevation1 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation1());
 61654        Elevation2 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation2());
 61655        Elevation3 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation3());
 61656        Elevation4 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation4());
 61657        Elevation5 = new BrandState(color: (surface ?? StyleDefaults.SurfaceColorLight).ToElevation5());
 61658        Error = new BrandState(color: error ?? StyleDefaults.ErrorColorLight);
 61659        Info = new BrandState(color: info ?? StyleDefaults.InfoColorLight);
 61660        Primary = new BrandState(color: primary ?? StyleDefaults.PrimaryColorLight);
 61661        Success = new BrandState(color: success ?? StyleDefaults.SuccessColorLight);
 61662        Secondary = new BrandState(color: secondary ?? StyleDefaults.SecondaryColorLight);
 61663        Surface = new BrandState(color: surface ?? StyleDefaults.SurfaceColorLight);
 61664        Tertiary = new BrandState(color: tertiary ?? StyleDefaults.TertiaryColorLight);
 61665        Warning = new BrandState(color: warning ?? StyleDefaults.WarningColorLight);
 61666    }
 67
 68    /// <summary>Gets the elevation level 1 color state, used for the lowest raised surfaces.</summary>
 22869    public BrandState Elevation1 { get; }
 70
 71    /// <summary>Gets the elevation level 2 color state, used for slightly raised surfaces.</summary>
 472    public BrandState Elevation2 { get; }
 73
 74    /// <summary>Gets the elevation level 3 color state, used for medium-raised UI regions.</summary>
 475    public BrandState Elevation3 { get; }
 76
 77    /// <summary>Gets the elevation level 4 color state, representing higher-depth UI layers.</summary>
 478    public BrandState Elevation4 { get; }
 79
 80    /// <summary>Gets the elevation level 5 color state, representing the highest raised surfaces.</summary>
 481    public BrandState Elevation5 { get; }
 82
 83    /// <summary>Gets the color state representing error or critical feedback visuals.</summary>
 32484    public BrandState Error { get; }
 85
 86    /// <summary>Gets the color state representing informational messages or neutral alerts.</summary>
 31287    public BrandState Info { get; }
 88
 89    /// <summary>Gets the primary color state used for dominant elements such as buttons or links.</summary>
 54090    public BrandState Primary { get; }
 91
 92    /// <summary>Gets the secondary color state used for complementary or background highlights.</summary>
 34093    public BrandState Secondary { get; }
 94
 95    /// <summary>Gets the success color state used for positive confirmations.</summary>
 31296    public BrandState Success { get; }
 97
 98    /// <summary>Gets the surface color state used as the base layer for background regions.</summary>
 59299    public BrandState Surface { get; }
 100
 101    /// <summary>Gets the tertiary color state used for subtle or decorative accents.</summary>
 312102    public BrandState Tertiary { get; }
 103
 104    /// <summary>Gets the warning color state used for cautionary alerts or partial issues.</summary>
 312105    public BrandState Warning { get; }
 106}