Dual slider for tunable white following color curve?

I’ve got a lot of tunable white lights around my house. Basically each light I can control brightness with one slider control and color temperature with a separate slider control. Most of the time I use preset scenes so I pair the dim level with the temperature for each scene. I can also manually use the dim slider for brightness and then use the temp slider for temp.

Ok so far so good…now I want to program a response curve so as I change the brightness it changes the temp automatically. For simplicity let’s just assume it’s linear for now. So if dim slide is at 1 the temp goes to 1. If dim slider goes to 78 then the temp slider moves to 78 at same time. Eventually I’ll apply a function to determine the proper temp for the dimness.

What is best way to accomplish this? Do I have to develop a custom card? If so before I embark on that is this possible with a custom card?

Yes I can easily do this with automation but worry about the lag.

Just use an automation.

Trigger on the brightness changing, adjust the colour temperature in the actions.