I want to set style attribute value dynamically while looping in template.
But LWC is warning me of this error message.
LWC1060: Template expression doesn't allow CallExpression
Below is my template.
<template for:each={colors} for:item="color">
<li key={color} class="slds-color-picker__swatch" role="presentation">
<a class="slds-color-picker__swatch-trigger" href="#" role="option" tabindex="0">
<span class="slds-swatch" style={makeColorStyle(color)}><--! warning here -->
<span class="slds-assistive-text">{color}</span>
</span>
</a>
</li>
</template>
How can I achieve my purpose?