GraphLine Color Property Delta Engine Documentation

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

public Color Color { get; set; }

Property Value

Type: Color
Remarks

Tests: DeltaEngine.Rendering2D.Graphs.Tests.GraphLineTests
Examples

3 unit tests call DeltaEngine.Rendering2D.Graphs.GraphLine.Color
[Test, CloseAfterFirstFrame]
public void CheckLineColor()
{
    var line = graph.CreateLine("", Color.Blue);
    line.AddPoint(Vector2D.Zero);
    line.AddPoint(Vector2D.One);
    Assert.AreEqual(Color.Blue, line.Color);
    Assert.AreEqual(Color.Blue, line.lines[0].Color);
    line.Color = Color.Green;
    Assert.AreEqual(Color.Green, line.Color);
}
[Test, CloseAfterFirstFrame]
public void ChangeLineColor()
{
    var line = graph.CreateLine("", Color.Blue);
    line.AddPoint(Vector2D.Zero);
    line.AddPoint(Vector2D.One);
    line.Color = Color.Green;
    Assert.AreEqual(Color.Green, line.Color);
    Assert.AreEqual(Color.Green, line.lines[0].Color);
}
[Test, CloseAfterFirstFrame]
public void TwoPointsDrawALine()
{
    GraphLine line = CreateLineWithTwoPoints();
    Assert.AreEqual(2, line.points.Count);
    Assert.AreEqual(1, line.lines.Count);
    Line2D line2D = line.lines[0];
    Assert.IsTrue(line2D.StartPoint.IsNearlyEqual(new Vector2D(0.462f, 0.5f)));
    Assert.IsTrue(line2D.EndPoint.IsNearlyEqual(new Vector2D(0.538f, 0.462f)));
    Assert.AreEqual(LineColor, line.Color);
}
See Also