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

626 B

title description categories keywords action
Colors Applicable to images, returns a slice of the most dominant colors using a simple histogram method.
related returnType signatures
[]string
RESOURCE.Colors

{{< new-in 0.104.0 >}}

{{ 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" %}}