How to apply linear gradient scheme on ag-grid cells angular?

Viewed 25

I have this color scheme to apply on the ag-grid cell based on their values and the values will range from -50 to 50

enter image description here

I have tried this to calculate the weight and provided rgb gradient on the cells under the cellStyle but I am getting only blue and white:

 let red = weight * 165 + (50 - weight) * 14;
let green = weight * 42 + (50 - weight) * 109;
let blue = weight * 8 + (50 - weight) * 60;
return {backgroundColor: 'rgb($(red),$(green),$(blue))'};

Can someone please help me where I am going wrong here?

0 Answers
Related