using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;

namespace ThickTcpUiInWindow.Themes
{
    /// <summary>
    /// 
    /// </summary>
    public static class Styles
    {
        static List<SolidColorBrush> randomColors = new List<SolidColorBrush>();
        static Styles()
        {
            randomColors.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#2195f2")));
            randomColors.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#f34336")));
            randomColors.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#fec007")));
            randomColors.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#607d8a")));
            randomColors.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#e81e63")));
            randomColors.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#4cae50")));
            randomColors.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3f51b4")));
            randomColors.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ccdb39")));

        }
        /// <summary>
        /// 获取随机颜色
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public static Brush GetForeground(int index)
        {
            //IEnumerable<SolidColorBrush> randomColors = Application.Current.FindResource("RandomColors") as IEnumerable<SolidColorBrush>;

            return randomColors.ElementAt(index % randomColors.Count());
        }
    }
}
