aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources/transform.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-09-21 16:24:54 +0200
committerBjørn Erik Pedersen <[email protected]>2022-09-22 15:57:35 +0200
commita4028112e340b20909746daca0f8cabb09cbf28f (patch)
tree3952d26c1d6fd4ac543617272b7a0311cd119339 /resources/transform.go
parent08f0984f918bb97d35c1765d3b94b1a9a1a3b9cd (diff)
downloadhugo-a4028112e340b20909746daca0f8cabb09cbf28f.tar.gz
hugo-a4028112e340b20909746daca0f8cabb09cbf28f.zip
resources/images: Add $image.Colors
Which returns the most dominant colors of an image using a simple histogram method. Fixes #10307
Diffstat (limited to 'resources/transform.go')
-rw-r--r--resources/transform.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/resources/transform.go b/resources/transform.go
index 7d81f9b21..14120fda0 100644
--- a/resources/transform.go
+++ b/resources/transform.go
@@ -213,6 +213,10 @@ func (r *resourceAdapter) Exif() *exif.ExifInfo {
return r.getImageOps().Exif()
}
+func (r *resourceAdapter) Colors() ([]string, error) {
+ return r.getImageOps().Colors()
+}
+
func (r *resourceAdapter) Key() string {
r.init(false, false)
return r.target.(resource.Identifier).Key()