< Summary

Information
Class: Allyaria.Theming.BrandTypes.BrandState
Assembly: Allyaria.Theming
File(s): /home/runner/work/allyaria/allyaria/src/Allyaria.Theming/BrandTypes/BrandState.cs
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 46
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Default()100%11100%
get_Disabled()100%11100%
get_Dragged()100%11100%
get_Focused()100%11100%
get_Hovered()100%11100%
get_Pressed()100%11100%
get_Visited()100%11100%

File(s)

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

#LineLine coverage
 1namespace Allyaria.Theming.BrandTypes;
 2
 3/// <summary>
 4/// Represents a collection of brand color palettes corresponding to different UI interaction states. Each state derives
 5/// its palette from a base color with adjusted tonal variations for accessibility and visual feedback.
 6/// </summary>
 7public sealed record BrandState
 8{
 9    /// <summary>Initializes a new instance of the <see cref="BrandState" /> struct using the specified base color.</sum
 10    /// <param name="color">The base <see cref="HexColor" /> used to generate state-specific palettes.</param>
 805911    public BrandState(HexColor color)
 12    {
 805913        Default = new BrandPalette(color: color);
 805914        Disabled = new BrandPalette(color: color.ToDisabled());
 805915        Dragged = new BrandPalette(color: color.ToDragged());
 805916        Focused = new BrandPalette(color: color.ToFocused());
 805917        Hovered = new BrandPalette(color: color.ToHovered());
 805918        Pressed = new BrandPalette(color: color.ToPressed());
 805919        Visited = new BrandPalette(color: color.ToVisited());
 805920    }
 21
 22    /// <summary>Gets the palette for the default (idle) visual state.</summary>
 324523    public BrandPalette Default { get; }
 24
 25    /// <summary>
 26    /// Gets the palette for the disabled (inactive) state, ensuring reduced contrast and visual de-emphasis.
 27    /// </summary>
 78528    public BrandPalette Disabled { get; }
 29
 30    /// <summary>Gets the palette for the dragged state, used when an element is being moved or repositioned.</summary>
 78531    public BrandPalette Dragged { get; }
 32
 33    /// <summary>Gets the palette for the focused state, emphasizing keyboard or programmatic focus visibility.</summary
 78534    public BrandPalette Focused { get; }
 35
 36    /// <summary>Gets the palette for the hovered state, providing feedback when the pointer is over an element.</summar
 78537    public BrandPalette Hovered { get; }
 38
 39    /// <summary>Gets the palette for the pressed (active) state, applied during interaction activation.</summary>
 78540    public BrandPalette Pressed { get; }
 41
 42    /// <summary>
 43    /// Gets the palette for the visited state, commonly used to indicate previously interacted links or items.
 44    /// </summary>
 78545    public BrandPalette Visited { get; }
 46}