The image resizing functions are very cool and I’m planning to use them a lot more in a project I’m working on.
While experimenting with my CSS, I figured it would be a interesting idea to be able to automatically pick a dominant colour from an image to use within your site. I’ve seen other libraries offer this feature, but I’m not sure where I saw it. The colour could be picked from the border of the image or by calculating from a blurred version of the image. I’m not sure which alghoritms these image libraries use.
You could then use this colour as the ‘placeholder’ color for when an image is loading, or tone it down (using Sass, for example) to use as a part of your design.
In the thing I’m working on right now, it could look like this:
{{ range .Resources.Match "default.*" }}
{{ $img := .Fill "500x250" }}
{{ $temp-color := .dominantColor }}
<header class="title" style="background: {{ $temp-color }} center center/cover url({{ $img.RelPermalink }}">
{{ end }}