Closed terryupton closed 6 years ago
Yeah, the error is due to you passing in an object/array as the second parameter of craft.imager.getDominantColor
. When the docs say:
craft.imager.getDominantColor(image [, quality=10, colorValue='hex'])
It doesn't mean that the method has two parameters, the second of which is an array. It means that the method has three parameters, and the last two are optional. So the correct syntax would be:
{{ craft.imager.getDominantColor(logo, 10, 'hex') }}
Thanks @aelvan 👍
I am trying to get the dominant colour with the following code; {{ craft.imager.getDominantColor(logo, {quality:10, colorValue:'hex'}) }}
However, this results in the following error: Unsupported operand types
Any ideas where I am going wrong?