How to use the input from two color sectors in a lambda light effect

Hello guys and girls,
I like to make with ESPhome an ws2811 LED stick with 70 leds that can be controlled by Home Assistant.
My idea is to have two color inputs. An starting color, an transition and an end color. For the transition I would like to have two sliders where I can select the led where the transition starts and where the transition ends. I truly believe there is a possibility to use the values from two color selectors and some slider inputs (visible and controllable in the HA GUI) in ESPhome, but I don’t have a clue where to start. Can anybody help me with this. I did build this LED sticks (3 of them) some years ago with Wemos d1 mini’s and put some modified Arduino code in them. They are now controlled by MQTT and the effect with the two colors is now hardcoded an can only be turned on or off. Kind regards, Edward.