From a1151b0fde3727a97e6150fc21d9375d35d89c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 21 Sep 2023 22:32:32 +0200 Subject: [PATCH] Add images.Opacity filter Fixes #11471 --- content/en/functions/images/index.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/content/en/functions/images/index.md b/content/en/functions/images/index.md index e42f4cdd8..fcd0796e3 100644 --- a/content/en/functions/images/index.md +++ b/content/en/functions/images/index.md @@ -34,6 +34,19 @@ A shorter version of the above, if you only need to apply the filter once: The above will overlay `$logo` in the upper left corner of `$img` (at position `x=50, y=50`). +## Opacity + +{{% funcsig %}} +images.Opacity SRC OPACITY +{{% /funcsig %}} + +Opacity creates a filter that changes the opacity of an image. +The OPACITY parameter must be in range (0, 1). + +```go-html-template +{{ $img := $img.Filter (images.Opacity 0.5 )}} +``` + ## Text Using the `Text` filter, you can add text to an image.