< Summary

Information
Class: Allyaria.Theming.BrandTypes.BrandVariant
Assembly: Allyaria.Theming
File(s): /home/runner/work/allyaria/allyaria/src/Allyaria.Theming/BrandTypes/BrandVariant.cs
Line coverage
100%
Covered lines: 46
Uncovered lines: 0
Coverable lines: 46
Total lines: 77
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
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%44100%
get_Dark()100%11100%
get_DarkVariant()100%11100%
get_Light()100%11100%
get_LightVariant()100%11100%

File(s)

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

#LineLine coverage
 1namespace 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>
 7public 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
 15315    public BrandVariant(BrandTheme? lightTheme = null, BrandTheme? darkTheme = null)
 16    {
 15317        Dark = darkTheme ?? new BrandTheme(
 15318            surface: StyleDefaults.SurfaceColorDark,
 15319            primary: StyleDefaults.PrimaryColorDark,
 15320            secondary: StyleDefaults.SecondaryColorDark,
 15321            tertiary: StyleDefaults.TertiaryColorDark,
 15322            error: StyleDefaults.ErrorColorDark,
 15323            warning: StyleDefaults.WarningColorDark,
 15324            success: StyleDefaults.SuccessColorDark,
 15325            info: StyleDefaults.InfoColorDark
 15326        );
 27
 15328        DarkVariant = new BrandTheme(
 15329            surface: Dark.Surface.Default.ForegroundColor,
 15330            primary: Dark.Primary.Default.ForegroundColor,
 15331            secondary: Dark.Secondary.Default.ForegroundColor,
 15332            tertiary: Dark.Tertiary.Default.ForegroundColor,
 15333            error: Dark.Error.Default.ForegroundColor,
 15334            warning: Dark.Warning.Default.ForegroundColor,
 15335            success: Dark.Success.Default.ForegroundColor,
 15336            info: Dark.Info.Default.ForegroundColor
 15337        );
 38
 15339        Light = lightTheme ?? new BrandTheme(
 15340            surface: StyleDefaults.SurfaceColorLight,
 15341            primary: StyleDefaults.PrimaryColorLight,
 15342            secondary: StyleDefaults.SecondaryColorLight,
 15343            tertiary: StyleDefaults.TertiaryColorLight,
 15344            error: StyleDefaults.ErrorColorLight,
 15345            warning: StyleDefaults.WarningColorLight,
 15346            success: StyleDefaults.SuccessColorLight,
 15347            info: StyleDefaults.InfoColorLight
 15348        );
 49
 15350        LightVariant = new BrandTheme(
 15351            surface: Light.Surface.Default.ForegroundColor,
 15352            primary: Light.Primary.Default.ForegroundColor,
 15353            secondary: Light.Secondary.Default.ForegroundColor,
 15354            tertiary: Light.Tertiary.Default.ForegroundColor,
 15355            error: Light.Error.Default.ForegroundColor,
 15356            warning: Light.Warning.Default.ForegroundColor,
 15357            success: Light.Success.Default.ForegroundColor,
 15358            info: Light.Info.Default.ForegroundColor
 15359        );
 15360    }
 61
 62    /// <summary>Gets the primary dark theme configuration.</summary>
 148963    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>
 14468    public BrandTheme DarkVariant { get; }
 69
 70    /// <summary>Gets the primary light theme configuration.</summary>
 148971    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>
 14476    public BrandTheme LightVariant { get; }
 77}