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)); }
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)); }
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); }
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); }
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)); }
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)); }
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()); }
public void UpdateBareJid(string bareJid) { Color color = MODEL.Image is null?ConsistentColorGenerator.GenForegroundColor(bareJid ?? "", false, false) : Colors.Transparent; MODEL.Background = GenerateLinearGradientBrush(color); }