Пример #1
0
        public void Test_ConsistentColorGeneratorRedGreenCorrection_4()
        {
            Color color = ConsistentColorGenerator.GenForegroundColor("*****@*****.**", true, false);

            Assert.IsTrue(color.R == (byte)(byte.MaxValue * 0.742));
            Assert.IsTrue(color.G == (byte)(byte.MaxValue * 0.359));
            Assert.IsTrue(color.B == (byte)(byte.MaxValue * 0.0));
        }
Пример #2
0
        public void Test_ConsistentColorGeneratorBlueCorrection_1()
        {
            Color color = ConsistentColorGenerator.GenForegroundColor("Romeo", false, true);

            Assert.IsTrue(color.R == (byte)(byte.MaxValue * 0.0));
            Assert.IsTrue(color.G == (byte)(byte.MaxValue * 0.535));
            Assert.IsTrue(color.B == (byte)(byte.MaxValue * 0.350));
        }
Пример #3
0
        public void Test_ConsistentColorGeneratorRedGreenCorrection_3()
        {
            Color color = ConsistentColorGenerator.GenForegroundColor("council", true, false);

            Assert.IsTrue(color.R == 233);
            Assert.IsTrue(color.G == 0);
            Assert.IsTrue(color.B == 100);
        }
Пример #4
0
        public void Test_ConsistentColorGeneratorRedGreenCorrection_2()
        {
            Color color = ConsistentColorGenerator.GenForegroundColor("😺", true, false);

            Assert.IsTrue(color.R == 222);
            Assert.IsTrue(color.G == 0);
            Assert.IsTrue(color.B == 167);
        }
Пример #5
0
        public void Test_ConsistentColorGeneratorRedGreenCorrection_1()
        {
            Color color = ConsistentColorGenerator.GenForegroundColor("Romeo", true, false);

            Assert.IsTrue(color.R == (byte)(byte.MaxValue * 0.865));
            Assert.IsTrue(color.G == (byte)(byte.MaxValue * 0.000));
            Assert.IsTrue(color.B == (byte)(byte.MaxValue * 0.686));
        }
Пример #6
0
        public void Test_ConsistentColorGeneratorNoCorrection_4()
        {
            Color color = ConsistentColorGenerator.GenForegroundColor("*****@*****.**", false, false);

            Assert.IsTrue(color.R == (byte)(byte.MaxValue * 0.0));
            Assert.IsTrue(color.G == (byte)(byte.MaxValue * 0.515));
            Assert.IsTrue(color.B == (byte)(byte.MaxValue * 0.573));
        }
Пример #7
0
        public void Test_ConsistentColorGeneratorBlueCorrection_3()
        {
            Color color = ConsistentColorGenerator.GenForegroundColor("council", false, true);

            Assert.IsTrue(color.R == (byte)(byte.MaxValue * 0.0));
            Assert.IsTrue(color.G == (byte)(byte.MaxValue * 0.524));
            Assert.IsTrue(color.B == (byte)(byte.MaxValue * 0.485));
        }
        //--------------------------------------------------------Attributes:-----------------------------------------------------------------\\
        #region --Attributes--


        #endregion
        //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
        #region --Constructors--


        #endregion
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is string s)
            {
                Color color = ConsistentColorGenerator.GenForegroundColor(s, false, false);
                return(new SolidColorBrush(color));
            }
            return(new SolidColorBrush());
        }
Пример #9
0
        public void UpdateBareJid(string bareJid)
        {
            Color color = MODEL.Image is null?ConsistentColorGenerator.GenForegroundColor(bareJid ?? "", false, false) : Colors.Transparent;

            MODEL.Background = GenerateLinearGradientBrush(color);
        }