hugo/docs/content/en/methods/resource/Colors.md
Bjørn Erik Pedersen 5fd1e74903
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

23 lines
626 B
Markdown

---
title: Colors
description: Applicable to images, returns a slice of the most dominant colors using a simple histogram method.
categories: []
keywords: []
action:
related: []
returnType: '[]string'
signatures: [RESOURCE.Colors]
---
{{< new-in 0.104.0 >}}
```go-html-template
{{ with resources.Get "images/a.jpg" }}
{{ .Colors }} → [#bebebd #514947 #768a9a #647789 #90725e #a48974]
{{ end }}
```
This method is fast, but if you also scale down your images, it would be good for performance to extract the colors from the scaled image.
{{% include "methods/resource/_common/global-page-remote-resources.md" %}}