---
title: TrimColor
summary: TrimColor identifies a rectangular border based on specified color and removes this / border from the edges of an image.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/fsthttp/imageopto/struct.TrimColor/
---

**Kind:** Struct  
**Module:** [imageopto](https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/fsthttp/imageopto/)  
**Package:** compute-sdk-go v1.11.0  
**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/fsthttp/imageopto/imageopto.go#L345

```go
type TrimColor struct {
	Color HexColor

	Threshold float32
}
```

TrimColor identifies a rectangular border based on specified color and removes this
/ border from the edges of an image.

## Fields

### Color

**Type:** `HexColor`

Color is the color to trim

### Threshold

**Type:** `float32`

Threshold specifies how different a color can be from the given trim color and still be trimmed.

Valid values are 0 (exact color only) to 1 (trim everything).

## Methods

### String

**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/fsthttp/imageopto/imageopto.go#L354

```go
func (t *TrimColor) String() string
```

**Returns**

`string`
