mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
resources/images: Add $image.Colors
Which returns the most dominant colors of an image using a simple histogram method. Fixes #10307
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user