# LuaColorCurveObjectAPI (widget methods): World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/LuaColorCurveObjectAPI

## Functions

### AddPoint

```lua
self:AddPoint(x, y)
```

Adds a single point to the curve.

Arguments:
- `x`: number
- `y`: colorRGBA

### ClearPoints

```lua
self:ClearPoints()
```

Removes all points from the curve. Evaluating an empty curve always yields a zero value.

### Copy

```lua
curve = self:Copy()
```

Returns a new copy of this curve.

Returns:
- `curve`: LuaColorCurveObject

### Evaluate

```lua
y = self:Evaluate(x)
```

Returns a calculated color value from the configured curve points.

Arguments:
- `x`: number

Returns:
- `y`: colorRGBA

### EvaluateUnpacked

```lua
yR, yG, yB, yA = self:EvaluateUnpacked(x)
```

Returns an unpacked calculated color value from the configured curve points.

Arguments:
- `x`: number

Returns:
- `yR`: number
- `yG`: number
- `yB`: number
- `yA`: number

### GetPoint

```lua
point = self:GetPoint(index)
```

Returns the vector for an individual point index on the curve.

Arguments:
- `index`: luaIndex

Returns:
- `point`: LuaColorCurvePoint, may be nil

### GetPointCount

```lua
count = self:GetPointCount()
```

Returns the total number of points on the curve.

Returns:
- `count`: size

### GetPoints

```lua
point = self:GetPoints()
```

Returns the vectors for all points on the curve.

Returns:
- `point`: LuaColorCurvePoint[]

### RemovePoint

```lua
self:RemovePoint(index)
```

Removes a single point from the curve. Raises an error if the supplied point index is out of range.

Arguments:
- `index`: luaIndex

### SetPoints

```lua
self:SetPoints(point)
```

Replaces all points on the curve.

Arguments:
- `point`: LuaColorCurvePoint[]

### SetToDefaults

```lua
self:SetToDefaults()
```

Resets all state on the curve, and clears the secret values flag.

## Tables

### LuaColorCurvePoint (structure)

- `x`: number
- `y`: colorRGBA

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
