# Sandbox.Gradient.AddColor

## Overload 1

```csharp
int AddColor(float x, in Color color)
```

Add a color position

### Parameters

- `x` (`float`)
- `in color` (`Color`)

### Returns

`int`

## Overload 2

```csharp
int AddColor(in ColorFrame keyframe)
```

Add given keyframe to this curve.

### Parameters

- `in keyframe` (`ColorFrame`): The keyframe to add.

### Returns

`int`: The position of newly added keyframe in the [Sandbox.Gradient.Colors](/api/Sandbox.Gradient/Colors) list.

Declared in [Sandbox.Gradient](/api/Sandbox.Gradient).
Assembly: `Sandbox.System`.
