> For the complete documentation index, see [llms.txt](https://imgo.gitbook.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://imgo.gitbook.io/en/api/color2hex.md).

# Color2Hex

Convert color to hex。

## Parameters

<table><thead><tr><th width="198.4826833846656">Parameter</th><th width="208.18338610093963">Type</th><th>Description</th></tr></thead><tbody><tr><td>url</td><td><code>string</code></td><td>图像资源</td></tr></tbody></table>

## Return Values

string

## Examples

```go
package main

import (
    "fmt"
    "github.com/fishtailstudio/imgo"
    "image/color"
)

func main() {
    fmt.Println(imgo.Color2Hex(color.White))
}
```

Output:

```
#FFFFFF
```
