public void Utilities_Gradient_GetColor_Middle_Test() { gradient.AddGradientPoint(0, new Color(0, 0, 0, byte.MaxValue)); gradient.AddGradientPoint(1, new Color(byte.MaxValue, 0, 0, byte.MaxValue)); var color = gradient.GetColor(0.5); var expectedColor = new Color(byte.MaxValue / 2, 0, 0, byte.MaxValue); Assert.AreEqual(expectedColor, color); }
public void GetColorTest(double alpha, byte r, byte g, byte b, byte a) { var color = gradient.GetColor(alpha); var expectedColor = new Color(r, g, b, a); Assert.Equal(expectedColor, color); }
// Update is called once per frame void Update() { if (m_rankInRecordObj != null) { Color color = m_gradient.GetColor(); SetColorRecord(m_myScoreObj, color); SetColorRecord(m_rankInRecordObj, color); } }