Plotly table conditional formatting in plotly.js

Hello, I am trying to do something like https://plot.ly/~empet/14689/table-with-cells-colored-according-to-th/#/ in plotly. js but can’t seem to get the syntax correct. Can someone please show me an example in plotly.js with conditional formatting? I tried to use:

fill: {
color: [
“rgba(140,124,66,1)”,
[
vals.forEach(function(vd) {
if ( vd.value >= -100) {
(“rgba(140,124,66,1)”);
} else {
(“rgba(143,66,244,1)”);
}
})
]
]
}

but i just get a column with a black fill.

Thanks!