< Summary

Information
Class: Allyaria.Theming.BrandTypes.Brand
Assembly: Allyaria.Theming
File(s): /home/runner/work/allyaria/allyaria/src/Allyaria.Theming/BrandTypes/Brand.cs
Line coverage
100%
Covered lines: 29
Uncovered lines: 0
Coverable lines: 29
Total lines: 56
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
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%22100%
get_Font()100%11100%
get_Variant()100%11100%
CreateHighContrastBrand()100%11100%

File(s)

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

#LineLine coverage
 1namespace Allyaria.Theming.BrandTypes;
 2
 3/// <summary>
 4/// Represents a brand configuration that encapsulates the font and theme variants (light and dark) used for visual styl
 5/// in the Allyaria Theming system.
 6/// </summary>
 7public sealed record Brand
 8{
 9    /// <summary>
 10    /// Initializes a new instance of the <see cref="Brand" /> struct with optional font and light/dark theme parameters
 11    /// </summary>
 12    /// <param name="font">The font configuration for the brand. Defaults to a new <see cref="BrandFont" /> if null.</pa
 13    /// <param name="lightTheme">The light theme configuration for the brand. Defaults to null if unspecified.</param>
 14    /// <param name="darkTheme">The dark theme configuration for the brand. Defaults to null if unspecified.</param>
 14815    public Brand(BrandFont? font = null, BrandTheme? lightTheme = null, BrandTheme? darkTheme = null)
 16    {
 14817        Font = font ?? new BrandFont();
 14818        Variant = new BrandVariant(lightTheme: lightTheme, darkTheme: darkTheme);
 14819    }
 20
 21    /// <summary>Gets the font configuration associated with this brand.</summary>
 2722    public BrandFont Font { get; }
 23
 24    /// <summary>Gets the light and dark theme variants for this brand.</summary>
 80525    public BrandVariant Variant { get; }
 26
 27    /// <summary>Creates a predefined <see cref="Brand" /> instance configured for high contrast accessibility.</summary
 28    /// <returns>
 29    /// A <see cref="Brand" /> instance with high-contrast surface, primary, secondary, tertiary, and status colors for 
 30    /// light and dark modes.
 31    /// </returns>
 32    public static Brand CreateHighContrastBrand()
 7333        => new(
 7334            font: new BrandFont(),
 7335            lightTheme: new BrandTheme(
 7336                surface: StyleDefaults.HighContrastSurfaceColorLight,
 7337                primary: StyleDefaults.HighContrastPrimaryColorLight,
 7338                secondary: StyleDefaults.HighContrastSecondaryColorLight,
 7339                tertiary: StyleDefaults.HighContrastTertiaryColorLight,
 7340                error: StyleDefaults.HighContrastErrorColorLight,
 7341                warning: StyleDefaults.HighContrastWarningColorLight,
 7342                success: StyleDefaults.HighContrastSuccessColorLight,
 7343                info: StyleDefaults.HighContrastInfoColorLight
 7344            ),
 7345            darkTheme: new BrandTheme(
 7346                surface: StyleDefaults.HighContrastSurfaceColorDark,
 7347                primary: StyleDefaults.HighContrastPrimaryColorDark,
 7348                secondary: StyleDefaults.HighContrastSecondaryColorDark,
 7349                tertiary: StyleDefaults.HighContrastTertiaryColorDark,
 7350                error: StyleDefaults.HighContrastErrorColorDark,
 7351                warning: StyleDefaults.HighContrastWarningColorDark,
 7352                success: StyleDefaults.HighContrastSuccessColorDark,
 7353                info: StyleDefaults.HighContrastInfoColorDark
 7354            )
 7355        );
 56}