# enabled

> Specifies whether the ColorBySpeedModule is enabled or disabled.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.ParticleSystemModule

```csharp
public bool enabled { get; set; }
```

### Remarks

Additional Resources: [ParticleSystem.colorBySpeed](/engine/6000.0/script-reference/unityengine/particlesystem/colorbyspeed.md).

### Examples

```csharp
using UnityEngine;
using System.Collections;

[RequireComponent(typeof(ParticleSystem))]
public class ExampleClass : MonoBehaviour
{
    private ParticleSystem ps;
    public float hSliderValue = 1.0f;

    void Start()
    {
        ps = GetComponent<ParticleSystem>();

        var colorBySpeed = ps.colorBySpeed;
        colorBySpeed.enabled = true;

        Gradient gradient = new Gradient();
        gradient.SetKeys(
            new GradientColorKey[] { new GradientColorKey(Color.green, 0.0f), new GradientColorKey(Color.red, 1.0f) },
            new GradientAlphaKey[] { new GradientAlphaKey(1.0f, 0.0f), new GradientAlphaKey(1.0f, 1.0f) }
        );

        colorBySpeed.color = new ParticleSystem.MinMaxGradient(gradient);
        colorBySpeed.range = new Vector2(1.0f, 5.0f);
    }

    void Update()
    {
        var main = ps.main;
        main.startSpeed = hSliderValue;
    }

    void OnGUI()
    {
        hSliderValue = GUI.HorizontalSlider(new Rect(25, 45, 100, 30), hSliderValue, 1.0f, 5.0f);
    }
}
```
