aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources/errorResource.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-04-15 10:09:25 +0200
committerBjørn Erik Pedersen <[email protected]>2024-04-16 10:02:46 +0200
commite197c7b29d8814d098bd53e9e7efd97c70f8de5f (patch)
treeb91bd66bb2eb27d2b1dc07637b66bcdd34951b93 /resources/errorResource.go
parent74e9129568e3b506a34205f11d024400f833a907 (diff)
downloadhugo-e197c7b29d8814d098bd53e9e7efd97c70f8de5f.tar.gz
hugo-e197c7b29d8814d098bd53e9e7efd97c70f8de5f.zip
Add Luminance to Color
To sort an image's colors from darkest to lightest, you can then do: ```handlebars {{ {{ $colorsByLuminance := sort $image.Colors "Luminance" }} ``` This uses the formula defined here: https://www.w3.org/TR/WCAG21/#dfn-relative-luminance Fixes #10450
Diffstat (limited to 'resources/errorResource.go')
-rw-r--r--resources/errorResource.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/resources/errorResource.go b/resources/errorResource.go
index 220869fc1..582c54f6d 100644
--- a/resources/errorResource.go
+++ b/resources/errorResource.go
@@ -128,7 +128,7 @@ func (e *errorResource) Exif() *exif.ExifInfo {
panic(e.ResourceError)
}
-func (e *errorResource) Colors() ([]string, error) {
+func (e *errorResource) Colors() ([]images.Color, error) {
panic(e.ResourceError)
}