How to output a task in the color of your choice in Excel EXPORT

It says to set visual to ‘base-colors’ and set cellColors to true, but it doesn’t work.

It works in the link below, but not in my code.

Currently, the output is working fine, but the color is black or gray on the timeline side.
Below is my code

gantt.templates.task_class = function (start, end, task) {
if (task.type === ‘project’) {
return ‘gantt-parent’
} else if (task.type === ‘milestone’) {
return ‘gant-milestone’
} else {
return ‘gant-lowest-child’
}
}

gantt.exportToExcel({
name: myName,
server: myServer,
local: myLocal,
columns: myColumns,
data: myData,
cellColors: true,
visual: ‘base-colors’,
})

.gantt-parent { background: #65c16f; } .gant-lowest-child { background: #3db9d3; } .'gant-milestone { background: #a6a6a6; }

When exporting a pdf or png, you can use the header: <style> ${this.getStyle()} </style>, I sent my css in this way and wondering how excel should handle it.

Hello,
I used your configuration, and everything works as expected on my end. Here’s an example: DHTMLX Snippet Tool . Could you please try to reproduce the issue and send it to me?

When exporting a pdf or png, you can use the header: <style> ${this.getStyle()} </style> , I sent my css in this way and wondering how excel should handle it.

You need to rely on the visual: 'base-colors' option, which applies the styles defined in the Gantt or in your CSS.