---
title: HexColor
summary: HexColor is a hex color
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/fsthttp/imageopto/struct.HexColor/
---

**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#L321

```go
type HexColor struct {
	R, G, B uint8

	A float32
}
```

HexColor is a hex color

## Fields

### R

**Type:** `uint8`

R, G, B are the amount of Red, Green, and Blue.

### G

**Type:** `uint8`

R, G, B are the amount of Red, Green, and Blue.

### B

**Type:** `uint8`

R, G, B are the amount of Red, Green, and Blue.

### A

**Type:** `float32`

A is the alpha and should range from 0 (transparent) to 1 (opaque).

## Methods

### String

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

```go
func (h *HexColor) String() string
```

**Returns**

`string`
