# Color

### Introduction

The Color property controls the color value used when drawing a visible Line.&#x20;

### Code Exampe - Creating a red line

The following code creates a visible red line:

```csharp
var line = ShapeManager.AddLine();
line.Color = Color.Red;
line.Visible = true;
line.SetFromAbsoluteEndpoints(Camera.Main.Position.AtZ(0), 
    Camera.Main.Position.AtZ(0) + new Vector3(100, 100, 0));
```

<figure><img src="https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2FcicqiV5p1iTgFy30pX20%2Fimage.png?alt=media&#x26;token=7d5fc5f5-1a89-46a2-ac9d-8245ec10f4a4" alt=""><figcaption><p>A red diagonal line</p></figcaption></figure>

### Code Example - Transparent Lines

The following shows a transparent white line. Note that colors are pre-multiplied so all color values must be multiplied by the alpha value.

The following code creates a half-transparent red line:

```csharp
var line = ShapeManager.AddLine();
var alpha = 0.5f;
line.Color = new Color(1 * alpha, 0 * alpha, 0 * alpha, alpha);
line.Visible = true;
line.SetFromAbsoluteEndpoints(Camera.Main.Position.AtZ(0), 
    Camera.Main.Position.AtZ(0) + new Vector3(100, 100, 0));
```

<figure><img src="https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2FsKfPquS52iknyGQBscfj%2Fimage.png?alt=media&#x26;token=cf8327ea-709f-4e19-950b-806024c99659" alt=""><figcaption><p>Half transparent line over a light blue square</p></figcaption></figure>

The transparency can be difficult to see without zooming in. The following image shows the corner of the blue rectangle zoomed in.

<figure><img src="https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2FA6vtoxmLrql8XwHRzaG2%2Fimage.png?alt=media&#x26;token=49d13a37-4622-45e4-a2ab-076a9a1afb8c" alt=""><figcaption><p>Transparent line overlapping a rectangle</p></figcaption></figure>
