public void Argb16Color4 (Boolean t, Byte r, Byte g, Byte b) { var color = new libtrx.Argb16Color4 (t, r, g, b); Console.WriteLine ("R: {0}/{1}", color.R, r); Console.WriteLine ("G: {0}/{1}", color.G, g); Console.WriteLine ("B: {0}/{1}", color.B, b); Assert.That (t == color.Transparent, "Transparency check failed"); Assert.That (Math.Abs (r - color.R) <= 7, string.Format ("R check failed: Error was {0}", r - color.R)); Assert.That (Math.Abs (g - color.G) <= 7, "G check failed"); Assert.That (Math.Abs (b - color.B) <= 7, "B check failed"); }
public void Argb16Color4(Boolean t, Byte r, Byte g, Byte b) { var color = new libtrx.Argb16Color4(t, r, g, b); Console.WriteLine("R: {0}/{1}", color.R, r); Console.WriteLine("G: {0}/{1}", color.G, g); Console.WriteLine("B: {0}/{1}", color.B, b); Assert.That(t == color.Transparent, "Transparency check failed"); Assert.That(Math.Abs(r - color.R) <= 7, string.Format("R check failed: Error was {0}", r - color.R)); Assert.That(Math.Abs(g - color.G) <= 7, "G check failed"); Assert.That(Math.Abs(b - color.B) <= 7, "B check failed"); }
/// <summary> /// Initializes a new instance of the <see cref="libtr.TexTile16"/> struct. /// </summary> /// <param name="tiles">The tiles.</param> public TexTile16 (Argb16Color4 [] tiles) : this () { fixed (UInt16 *ptr = Tiles) { for (var i = 0; i < Math.Min (tiles.Length, 65536); i++) *(ptr + i) = tiles [i].Value; } }