Color B Property Delta Engine Documentation

Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public byte B { get; set; }

Property Value

Type: Byte
Remarks

Tests: DeltaEngine.Tests.Datatypes.ColorTests
Examples

6 unit tests call DeltaEngine.Datatypes.Color.B
[Test]
public void CreateWithBytes()
{
    var color = new Color(1, 2, 3, 4);
    Assert.AreEqual(1, color.R);
    Assert.AreEqual(2, color.G);
    Assert.AreEqual(3, color.B);
    Assert.AreEqual(4, color.A);
}
[Test]
public void NonByteComponentThrowsError()
{
    Assert.Throws<Color.InvalidColorComponentValue>(() => new Color("R=1,G=999,B=3,A=4"));
}
[Test]
public void GetRandomBrightColor()
{
    Color color = Color.GetRandomBrightColor();
    Assert.IsTrue(color.R > 127);
    Assert.IsTrue(color.G > 127);
    Assert.IsTrue(color.B > 127);
    Assert.AreEqual(255, color.A);
}
See Also