using System;

namespace EonaCat.LogStack;

// This file is part of the EonaCat project(s) which is released under the Apache License.
// See the LICENSE file or go to https://EonaCat.com/License for full license details.

/// <summary>
///     Colors to use when writing to the console.
/// </summary>
public class ColorSchema
{
    /// <summary>
    ///     The color to use for critical messages.
    /// </summary>
    public ColorScheme Critical = new(ConsoleColor.DarkRed, ConsoleColor.Black);

    /// <summary>
    ///     The color to use for debug messages.
    /// </summary>
    public ColorScheme Debug = new(ConsoleColor.Green, ConsoleColor.Black);

    /// <summary>
    ///     The color to use for error messages.
    /// </summary>
    public ColorScheme Error = new(ConsoleColor.Red, ConsoleColor.Black);

    /// <summary>
    ///     The color to use for informational messages.
    /// </summary>
    public ColorScheme Info = new(ConsoleColor.Blue, ConsoleColor.Black);

    /// <summary>
    ///     The color to use for emergency messages.
    /// </summary>
    public ColorScheme Trace = new(ConsoleColor.Cyan, ConsoleColor.Black);

    /// <summary>
    ///     The color to use for alert messages.
    /// </summary>
    public ColorScheme Traffic = new(ConsoleColor.DarkMagenta, ConsoleColor.Black);

    /// <summary>
    ///     The color to use for warning messages.
    /// </summary>
    public ColorScheme Warning = new(ConsoleColor.DarkYellow, ConsoleColor.Black);
}

/// <summary>
///     Color scheme for logging messages.
/// </summary>
public class ColorScheme
{
    /// <summary>
    ///     Background color.
    /// </summary>
    public ConsoleColor Background = Console.BackgroundColor;

    /// <summary>
    ///     Foreground color.
    /// </summary>
    public ConsoleColor Foreground = Console.ForegroundColor;

    /// <summary>
    ///     Instantiates a new color scheme.
    /// </summary>
    /// <param name="foreground">Foreground color.</param>
    /// <param name="background">Background color.</param>
    public ColorScheme(ConsoleColor foreground, ConsoleColor background)
    {
        Foreground = foreground;
        Background = background;
    }
}